[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Mon Aug 22 09:09:02 MDT 2011


The branch, master has been updated
       via  3fc2bc3 s3-net: Added documentation for net_rpc_conf functions
       via  3f3b0c0 docs: Added documentation for net rpc conf.
       via  33de7eb s3-test: Added net conf tests to tests.py
       via  2c11d8f s3-test: Added new testsuites for test net [rpc] conf
       via  94db542 s3-test: added samba3.blackbox.net.rpc.registry.roundtrip testsuite
       via  ed233db s3-test: Enhanced the net registry roundtrip test script
       via  57b7fb7 s3-net: Implemented net rpc conf import command
       via  a00851f s3-net: Added net rpc conf import command to net rpc conf
       via  66583da s3-net: Implemented net rpc conf addshare command
       via  16b4637 s3-net: Added net rpc conf addshare command to net rpc conf
       via  7ee8a49 s3-net: Implemented net rpc conf setincludes command
       via  f986297 s3-net: Added net rpc conf setincludes command to net rpc conf
       via  0c7f1d3 s3-net: Implemented net rpc conf setparm command
       via  ffe98b5 s3-net: Added net rpc conf setparm command to net rpc conf
       via  1a3b88c s3-net: Implemented net rpc conf delparm command
       via  689edf8 s3-net: Added net rpc conf delparm command to net rpc conf
       via  f370965 s3-net: Refactored part of rpc_conf_delincludes_internal
       via  4b3e2ad s3-net: Created function net_rpc_conf_del_value
       via  704d7d0 s3-net: Implemented net rpc conf delincludes command
       via  a974f01 s3-net: Added net rpc conf delincludes command to net rpc conf
       via  8d335a3 s3-net: Implemented net rpc conf getincludes command
       via  b52bfc1 s3-net: Added net rpc conf getincludes command to net rpc conf
       via  5a36306 s3-net: Implemented net rpc conf getparm command
       via  8e2ee72 s3-net: Added net rpc conf getparm command to net rpc conf
       via  7de814c s3-net: Implemented net rpc conf delshare command
       via  4728cf6 s3-net: Added net rpc conf delshare command to net rpc conf
       via  f94c8e3 s3-net: Implemented net rpc conf drop command
       via  01e80f8 s3-net: Added net rpc conf drop command to net rpc conf
       via  5f8ec78 s3-net: Implemented net rpc conf showshare command
       via  2db3696 s3-net: Added net rpc conf showshare command to net rpc conf
       via  ed0c5f5 s3-net: Implemented net rpc conf listshares command.
       via  1ca6e99 s3-net: Added net rpc conf listshares command to net rpc conf
       via  8efd30c s3-net: rpc_conf_list now uses the wrapper rpc_conf_open_conf
       via  f16d092 s3-net: Added rpc_conf_open_conf function
       via  08be91b s3-net: Added the net rpc conf list command.
       via  283da12 s3-net: Added the command rpc conf to the net binary.
       via  b46655b s3-net: Fixed whitespace errors
      from  43c0863 set passdb backend in Samba4 make test environments too

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 3fc2bc34a54870ad698153746190dff72be3dd8d
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Sun Aug 21 19:58:01 2011 +0300

    s3-net: Added documentation for net_rpc_conf functions
    
    Added comments to most functions of net rpc conf for easier
    understanding of the code.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Mon Aug 22 17:08:15 CEST 2011 on sn-devel-104

commit 3f3b0c04df0696e525ce132c5a01cfa25a86a27a
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Sun Aug 21 17:42:33 2011 +0300

    docs: Added documentation for net rpc conf.
    
    Changed the manual page for net to also show the posibility
    of remote configuration of a Samba server via net rpc conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 33de7ebcfcc6c6580f597d1d1b0005b4db924dbe
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Aug 17 17:58:59 2011 +0300

    s3-test: Added net conf tests to tests.py
    
    The tests are added as blackbox tests and they can be called with
    the wildcard source3.blackbox.net.*.conf with either 'local' or 'rpc'
    instead of '*' .
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 2c11d8f177bf6ae828b098644a4903e6e4bc1876
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Thu Aug 11 12:50:47 2011 +0300

    s3-test: Added new testsuites for test net [rpc] conf
    
    The script tests all commands present in the net conf tool.
    It is also possible to provide a fourth command line parameter
    'rpc' in order to run the tests with the use of rpc.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 94db542f60c6c03a6764a15503c5bd4f1d291ad9
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Aug 10 12:05:50 2011 +0300

    s3-test: added samba3.blackbox.net.rpc.registry.roundtrip testsuite
    
    The testsuite makes use of the rpc mode from the registry roundtrip
    script to test net rpc conf / net rpc registry
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit ed233dba9a2b755ce4baf1385099ca937ae96e0b
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Aug 10 11:58:25 2011 +0300

    s3-test: Enhanced the net registry roundtrip test script
    
    The script now supports an rpc mode, which is triggered by the
    presence of a fourth command line parameter "rpc"
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 57b7fb7256e0d4e09c29e48950820f80d5c613dc
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Aug 3 23:19:21 2011 +0300

    s3-net: Implemented net rpc conf import command
    
    The function takes a local file in smb.conf format,
    uses calls to smbconf to create smbconf_service structs,
    which are then placed in the remote registry.
    
    The function also provides a test module to only print
    the changes that it would make.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit a00851f33767f466e9d95b4bcac6fecaf26b0fbf
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Aug 3 16:07:46 2011 +0300

    s3-net: Added net rpc conf import command to net rpc conf
    
    The function only appears in the commands list usage of net rpc
    conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 66583da28d002397ff281efdd9b1a4af5ed497ec
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Aug 3 16:01:38 2011 +0300

    s3-net: Implemented net rpc conf addshare command
    
    The function is mostly a wrapper around a series of setparm
    commands. It can be used to quickly set up a share with simple
    parameters.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 16b463739b00cb18e7c16933d066b603f365ee7d
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Aug 3 15:58:54 2011 +0300

    s3-net: Added net rpc conf addshare command to net rpc conf
    
    The function only appears in the commands list usage of net rpc
    conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 7ee8a492c67464ce5ac1a999637c639da7b4593f
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Sat Jul 30 17:10:19 2011 +0300

    s3-net: Implemented net rpc conf setincludes command
    
    The function creates the share key if it does not exist.
    If the share key was present it deletes the previous includes.
    After this the function sets the new includes accordingly.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit f9862971c1d97dae251da5f21662b09d87a5aa62
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Sat Jul 30 16:55:43 2011 +0300

    s3-net: Added net rpc conf setincludes command to net rpc conf
    
    The function only appears in the commands list usage of net rpc
    conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 0c7f1d32e8718897c7aa207ae78489e3c455ff67
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Sat Jul 30 16:53:59 2011 +0300

    s3-net: Implemented net rpc conf setparm command
    
    The function creates the share key if it does not exist.
    If the share key was present it deletes the previous value.
    After this the function sets the new value accordingly.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit ffe98b51eff0522d76371e9fb556ca91ddef2d9e
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Sat Jul 30 16:51:44 2011 +0300

    s3-net: Added net rpc conf setparm command to net rpc conf
    
    The function only appears in the commands list usage of net rpc
    conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 1a3b88cfb369a9d3ab5545b56b5242489cef6c2d
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Tue Jul 26 13:48:34 2011 +0300

    s3-net: Implemented net rpc conf delparm command
    
    The function makes use of existing code from delincludes.
    It has the same logic, except it uses the second argument
    passed to determine which value to delete from the registry.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 689edf8ae1e6a3df60b11a7b1e0c2dcfae2c119a
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Tue Jul 26 13:36:23 2011 +0300

    s3-net: Added net rpc conf delparm command to net rpc conf
    
    The function only appears in the commands list usage of net rpc
    conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit f370965c34052855e577dea17bb510372bdc496d
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Tue Jul 26 13:25:33 2011 +0300

    s3-net: Refactored part of rpc_conf_delincludes_internal
    
    The function now makes use of rpc_conf_del_value to delete
    the includes of a given share.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 4b3e2adf8c8d8e507e66a8dd6fcd4b6d211c8388
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Tue Jul 26 13:24:58 2011 +0300

    s3-net: Created function net_rpc_conf_del_value
    
    Function is used to refactor some of the code used in
    delincludes and also to be used in the other key manipulating
    functions.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 704d7d02ac9231d30977bbbd4f469fe83af4d71d
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Tue Jul 26 12:44:42 2011 +0300

    s3-net: Implemented net rpc conf delincludes command
    
    The function openes the key attached to the service passed as a
    parameter to the command and it uses dcerpc_winreg_DeleteValue to
    delete the includes value if it exists
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit a974f01b6bfad6ad415d08b5411c787dd5f566d2
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Tue Jul 26 10:36:17 2011 +0300

    s3-net: Added net rpc conf delincludes command to net rpc conf
    
    The function only appears in the commands list usage of net rpc
    conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 8d335a3ad897037309f261986442a6f5716e26e7
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Tue Jul 26 01:32:23 2011 +0300

    s3-net: Implemented net rpc conf getincludes command
    
    The function creates a smconf_service struct that holds the share
    passed as the first argument to the command and searches in it for
    "include" parameters. If any are found, they are displayed.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit b52bfc1a9a5179324e832bd8dbd579e43add6d60
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Tue Jul 26 01:16:45 2011 +0300

    s3-net: Added net rpc conf getincludes command to net rpc conf
    
    The function only appears in the commands list usage of net rpc
    conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 5a36306704becf60f3a7ea79ec33889a134768f4
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Aug 17 17:01:30 2011 +0300

    s3-net: Implemented net rpc conf getparm command
    
    The function creates a smconf_service struct that holds the share
    passed as the first argument to the command and searches in it for
    the parameter passed as the second argument to the command
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 8e2ee72bcd16d1fe3d2ac472ca3f7ce8cb264e75
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Mon Jul 25 18:20:01 2011 +0300

    s3-net: Added net rpc conf getparm command to net rpc conf
    
    The function only appears in the commands list usage of net rpc conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 7de814c5a74b578a717af512aebf1f2d47995e6d
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Fri Jul 22 00:19:58 2011 +0300

    s3-net: Implemented net rpc conf delshare command
    
    The function makes use of dcerpc_winreg_delete_subkeys_recursive
    to clear the share.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 4728cf66c5627ad19a1bcf819fd1f090d1e87a44
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Fri Jul 15 19:22:34 2011 +0300

    s3-net: Added net rpc conf delshare command to net rpc conf
    
    The function only appears in the commands list usage of net rpc conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit f94c8e366fa72328c242130cf105e0e3d80f23aa
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Thu Jul 14 00:30:06 2011 +0300

    s3-net: Implemented net rpc conf drop command
    
    The function makes use of dcerpc_winreg_delete_subkeys_recursive
    to clear the configuration.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 01e80f81d80d318c321e873fde78e9e1efafaf72
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Thu Jul 14 00:01:15 2011 +0300

    s3-net: Added net rpc conf drop command to net rpc conf
    
    The function only appears in the commands list usage of net rpc conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 5f8ec78768ade79e2fb8db92a4ca534284ea4d87
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Aug 17 16:42:48 2011 +0300

    s3-net: Implemented net rpc conf showshare command
    
    The function has the same logic as net rpc conf list, however it
    only loads the specific share.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 2db3696303962eb4ef764c184f7922958db19562
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Jul 13 23:18:00 2011 +0300

    s3-net: Added net rpc conf showshare command to net rpc conf
    
    The function only appears in the commands list usage of net rpc conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit ed0c5f54aa4c1afb0e39369973be64a22d18eaf4
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Jul 13 23:04:18 2011 +0300

    s3-net: Implemented net rpc conf listshares command.
    
    The function prints the names of the remote shares found, one per line.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 1ca6e991415bd1650c1a7e5849d749a8c2e81bc6
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Jul 13 23:01:35 2011 +0300

    s3-net: Added net rpc conf listshares command to net rpc conf
    
    The function only appears in the commands list usage of net rpc conf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 8efd30ca610692fad3103ae7c9de57fc46206763
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Jul 13 22:57:08 2011 +0300

    s3-net: rpc_conf_list now uses the wrapper rpc_conf_open_conf
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit f16d092ad91d96a99bd5d4935d6614876950c112
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Jul 13 22:49:59 2011 +0300

    s3-net: Added rpc_conf_open_conf function
    
    The function is used as a wrapper to open the HKLM hive key and
    the smbconf key.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 08be91b0119fbc5fff8ad80b1f8dedc79d467dda
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Tue Jul 26 00:11:15 2011 +0300

    s3-net: Added the net rpc conf list command.
    
    The command make use of the smbconf_service struct,
    via the function rpc_conf_get_share(). This allows for
    further expansion with the use of smbconf.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 283da12a73ea3edc49a63f7375bc2c64ed36e2b1
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Wed Jul 13 21:17:08 2011 +0300

    s3-net: Added the command rpc conf to the net binary.
    
    The net binary now has an extra item linked to it, the
    net_rpc_conf.c module.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit b46655bd18a92560524ea8d1a6859ac56feea2a9
Author: Vicentiu Ciorbaru <cvicentiu at gmail.com>
Date:   Sun Aug 21 19:37:10 2011 +0300

    s3-net: Fixed whitespace errors
    
    Fixed previously existing whitespace errors in net_rpc.c
    
    Signed-off-by: Michael Adam <obnox at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages-3/net.8.xml                      |   57 +-
 source3/Makefile.in                                |    1 +
 source3/script/tests/test_net_conf.sh              |  970 ++++++++
 .../script/tests/test_net_registry_roundtrip.sh    |   27 +-
 source3/selftest/tests.py                          |   11 +-
 source3/utils/net_proto.h                          |    3 +
 source3/utils/net_rpc.c                            |   22 +-
 source3/utils/net_rpc_conf.c                       | 2481 ++++++++++++++++++++
 source3/wscript_build                              |    1 +
 9 files changed, 3524 insertions(+), 49 deletions(-)
 create mode 100755 source3/script/tests/test_net_conf.sh
 create mode 100644 source3/utils/net_rpc_conf.c


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/net.8.xml b/docs-xml/manpages-3/net.8.xml
index 2c6c11e..6e6b7e3 100644
--- a/docs-xml/manpages-3/net.8.xml
+++ b/docs-xml/manpages-3/net.8.xml
@@ -1656,11 +1656,12 @@ shares created by other users.
 </refsect2>
 
 <refsect2>
-<title>CONF</title>
+<title>[RPC] CONF</title>
 
 <para>Starting with version 3.2.0, a Samba server can be configured by data
 stored in registry. This configuration data can be edited with the new "net
-conf" commands.
+conf" commands. There is also the possiblity to configure a remote Samba server
+by enabling the RPC conf mode and specifying the the address of the remote server.
 </para>
 
 <para>
@@ -1678,27 +1679,27 @@ See the <citerefentry><refentrytitle>smb.conf</refentrytitle>
 
 <para>The conf commands are:
 <simplelist>
-<member>net conf list - Dump the complete configuration in smb.conf like
+<member>net [rpc] conf list - Dump the complete configuration in smb.conf like
 format.</member>
-<member>net conf import - Import configuration from file in smb.conf
+<member>net [rpc] conf import - Import configuration from file in smb.conf
 format.</member>
-<member>net conf listshares - List the registry shares.</member>
-<member>net conf drop - Delete the complete configuration from
+<member>net [rpc] conf listshares - List the registry shares.</member>
+<member>net [rpc] conf drop - Delete the complete configuration from
 registry.</member>
-<member>net conf showshare - Show the definition of a registry share.</member>
-<member>net conf addshare - Create a new registry share.</member>
-<member>net conf delshare - Delete a registry share.</member>
-<member>net conf setparm - Store a parameter.</member>
-<member>net conf getparm - Retrieve the value of a parameter.</member>
-<member>net conf delparm - Delete a parameter.</member>
-<member>net conf getincludes - Show the includes of a share definition.</member>
-<member>net conf setincludes - Set includes for a share.</member>
-<member>net conf delincludes - Delete includes from a share definition.</member>
+<member>net [rpc] conf showshare - Show the definition of a registry share.</member>
+<member>net [rpc] conf addshare - Create a new registry share.</member>
+<member>net [rpc] conf delshare - Delete a registry share.</member>
+<member>net [rpc] conf setparm - Store a parameter.</member>
+<member>net [rpc] conf getparm - Retrieve the value of a parameter.</member>
+<member>net [rpc] conf delparm - Delete a parameter.</member>
+<member>net [rpc] conf getincludes - Show the includes of a share definition.</member>
+<member>net [rpc] conf setincludes - Set includes for a share.</member>
+<member>net [rpc] conf delincludes - Delete includes from a share definition.</member>
 </simplelist>
 </para>
 
 <refsect3>
-<title>CONF LIST</title>
+<title>[RPC] CONF LIST</title>
 
 <para>
 Print the configuration data stored in the registry in a smb.conf-like format to
@@ -1707,7 +1708,7 @@ standard output.
 </refsect3>
 
 <refsect3>
-<title>CONF IMPORT <replaceable>[--test|-T]</replaceable> <replaceable>filename</replaceable> <replaceable>[section]</replaceable></title>
+<title>[RPC] CONF IMPORT <replaceable>[--test|-T]</replaceable> <replaceable>filename</replaceable> <replaceable>[section]</replaceable></title>
 
 <para>
 This command imports configuration from a file in smb.conf format.
@@ -1723,7 +1724,7 @@ registry, and the resulting configuration is printed to standard output instead.
 </refsect3>
 
 <refsect3>
-<title>CONF LISTSHARES</title>
+<title>[RPC] CONF LISTSHARES</title>
 
 <para>
 List the names of the shares defined in registry.
@@ -1731,7 +1732,7 @@ List the names of the shares defined in registry.
 </refsect3>
 
 <refsect3>
-<title>CONF DROP</title>
+<title>[RPC] CONF DROP</title>
 
 <para>
 Delete the complete configuration data from registry.
@@ -1739,7 +1740,7 @@ Delete the complete configuration data from registry.
 </refsect3>
 
 <refsect3>
-<title>CONF SHOWSHARE <replaceable>sharename</replaceable></title>
+<title>[RPC] CONF SHOWSHARE <replaceable>sharename</replaceable></title>
 
 <para>
 Show the definition of the share or section specified. It is valid to specify
@@ -1749,7 +1750,7 @@ registry.
 </refsect3>
 
 <refsect3>
-<title>CONF ADDSHARE <replaceable>sharename</replaceable> <replaceable>path</replaceable> [<replaceable>writeable={y|N}</replaceable> [<replaceable>guest_ok={y|N}</replaceable> [<replaceable>comment</replaceable>]]] </title>
+<title>[RPC] CONF ADDSHARE <replaceable>sharename</replaceable> <replaceable>path</replaceable> [<replaceable>writeable={y|N}</replaceable> [<replaceable>guest_ok={y|N}</replaceable> [<replaceable>comment</replaceable>]]] </title>
 
 <para>Create a new share definition in registry.
 The sharename and path have to be given. The share name may
@@ -1761,7 +1762,7 @@ commands.
 </refsect3>
 
 <refsect3>
-<title>CONF DELSHARE <replaceable>sharename</replaceable></title>
+<title>[RPC] CONF DELSHARE <replaceable>sharename</replaceable></title>
 
 <para>
 Delete a share definition from registry.
@@ -1769,7 +1770,7 @@ Delete a share definition from registry.
 </refsect3>
 
 <refsect3>
-<title>CONF SETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable> <replaceable>value</replaceable></title>
+<title>[RPC] CONF SETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable> <replaceable>value</replaceable></title>
 
 <para>
 Store a parameter in registry. The section may be global or a sharename.
@@ -1778,7 +1779,7 @@ The section is created if it does not exist yet.
 </refsect3>
 
 <refsect3>
-<title>CONF GETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
+<title>[RPC] CONF GETPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
 
 <para>
 Show a parameter stored in registry.
@@ -1786,7 +1787,7 @@ Show a parameter stored in registry.
 </refsect3>
 
 <refsect3>
-<title>CONF DELPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
+<title>[RPC] CONF DELPARM <replaceable>section</replaceable> <replaceable>parameter</replaceable></title>
 
 <para>
 Delete a parameter stored in registry.
@@ -1794,7 +1795,7 @@ Delete a parameter stored in registry.
 </refsect3>
 
 <refsect3>
-<title>CONF GETINCLUDES <replaceable>section</replaceable></title>
+<title>[RPC] CONF GETINCLUDES <replaceable>section</replaceable></title>
 
 <para>
 Get the list of includes for the provided section (global or share).
@@ -1820,7 +1821,7 @@ data from other registry keys.
 </refsect3>
 
 <refsect3>
-<title>CONF SETINCLUDES <replaceable>section</replaceable> [<replaceable>filename</replaceable>]+</title>
+<title>[RPC] CONF SETINCLUDES <replaceable>section</replaceable> [<replaceable>filename</replaceable>]+</title>
 
 <para>
 Set the list of includes for the provided section (global or share) to the given
@@ -1830,7 +1831,7 @@ macros like %I.
 </refsect3>
 
 <refsect3>
-<title>CONF DELINCLUDES <replaceable>section</replaceable></title>
+<title>[RPC] CONF DELINCLUDES <replaceable>section</replaceable></title>
 
 <para>
 Delete the list of includes from the provided section (global or share).
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 39e62cc..c633510 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1197,6 +1197,7 @@ NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_help.o \
 	   utils/net_eventlog.o \
 	   utils/net_printing.o \
 	   utils/net_rpc_trust.o \
+	   utils/net_rpc_conf.o\
 	   $(LIBNDR_NTPRINTING_OBJ) \
 	   $(LIBNDR_PREG_OBJ) \
 	   $(LIBCLI_SPOOLSS_OBJ) \
diff --git a/source3/script/tests/test_net_conf.sh b/source3/script/tests/test_net_conf.sh
new file mode 100755
index 0000000..ee2903b
--- /dev/null
+++ b/source3/script/tests/test_net_conf.sh
@@ -0,0 +1,970 @@
+#!/bin/sh
+#
+# Blackbox test for net [rpc] conf.
+#
+# Copyright (C) 2011 Vicentiu Ciorbaru <cvicentiu at gmail.com>
+
+if [ $# -lt 3 ]; then
+cat <<EOF
+Usage: test_net_conf.sh SCRIPTDIR SERVERCONFFILE CONFIGURATION [rpc]
+EOF
+exit 1;
+fi
+
+SCRIPTDIR="$1"
+SERVERCONFFILE="$2"
+CONFIGURATION="$3"
+RPC="$4"
+
+LOGDIR_PREFIX="conf_test"
+
+# remove old logs:
+for OLDDIR in $(find ${PREFIX} -type d -name "${LOGDIR_PREFIX}_*") ; do
+	echo "removing old directory ${OLDDIR}"
+	rm -rf ${OLDDIR}
+done
+
+
+NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
+DIR=$(mktemp -d ${PREFIX}/${LOGDIR_PREFIX}_XXXXXX)
+LOG=$DIR/log
+
+
+if test "x${RPC}" = "xrpc" ; then
+	NETCMD="${NET} -U${USERNAME}%${PASSWORD} -I ${SERVER_IP} rpc"
+else
+	NETCMD="${NET}"
+fi
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+
+failed=0
+
+SED_INVALID_PARAMS="{
+s/lock directory/;&/g
+s/lock dir/;&/g
+s/modules dir/;&/g
+s/logging/;&/g
+s/status/;&/g
+s/logdir/;&/g
+s/read prediction/;&/g
+s/mkprofile/;&/g
+s/valid chars/;&/g
+s/timesync/;&/g
+s/sambaconf/;&/g
+s/logtype/;&/g
+s/servername/;&/g
+s/postscript/;&/g
+}"
+
+REGPATH="HKLM\Software\Samba"
+
+log_print() {
+    RC=$?
+    echo "CMD: $*" >>$LOG
+    echo "RC: $RC" >> $LOG
+    return $RC
+#    echo -n .
+}
+
+test_conf_addshare()
+{
+    echo '\nTesting conf addshare' >> $LOG
+    echo ------------------------- >> $LOG
+    echo '\nDropping existing configuration' >> $LOG
+
+    $NETCMD conf drop
+    log_print $NETCMD conf drop
+    test "x$?" = "x0" || {
+	echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+	return 1
+    }
+
+#create a lot of shares
+    for i in $(seq 1 100); do
+	if [ $(($i % 2)) -eq 0 ]; then
+		$NETCMD conf addshare share$i /tmp "writeable=y" "guest_ok=n" \
+					   "test comment" >>$DIR/addshare_exp \
+							  2>>$DIR/addshare_exp
+		log_print $NETCMD conf addshare share$i /tmp "writeable=y" "guest_ok=n" \
+					   "test comment"
+	else
+		$NETCMD conf addshare share$i /tmp "writeable=n" "guest_ok=y" \
+					   "test comment" >>$DIR/addshare_exp \
+							  2>>$DIR/addshare_exp
+		log_print $NETCMD conf addshare share$i /tmp "writeable=n" "guest_ok=y" \
+					   "test comment"
+	fi
+	test "x$?" = "x0" || {
+		echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+		return 1
+	}
+    done
+
+    $NETCMD conf listshares > $DIR/listshares_out
+    log_print $NETCMD conf listshares
+    test "x$?" = "x0" || {
+	echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+	return 1
+    }
+
+    for i in $(seq 1 100); do
+	grep "share$i" $DIR/listshares_out >/dev/null 2>>$LOG
+	if [ "$?" = "1" ]; then
+		echo "ERROR: share not found" | tee -a $LOG
+		return 1
+	fi
+    done
+
+#check the integrity of the shares
+#if it fails, it can also point to an error in showshare
+    for i in $(seq 1 100); do
+	$NETCMD conf showshare share$i > $DIR/showshare_out
+	test "x$?" = "x0" || {
+		echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+		return 1
+	}
+
+	grep "path" $DIR/showshare_out >/dev/null 2>>$LOG
+	if [ "$?" = "1" ]; then
+		echo "ERROR: share not found" | tee -a $LOG
+		return 1
+	fi
+
+	if [ $(($i % 2)) -eq 0 ]; then
+		grep "read only *= *no" $DIR/showshare_out >/dev/null 2>>$LOG
+		if [ "$?" = "1" ]; then
+			echo "ERROR: share not set correctly" | tee -a $LOG
+			return 1
+		fi
+	else
+		grep "read only *= *yes" $DIR/showshare_out >/dev/null 2>>$LOG
+		if [ "$?" = "1" ]; then
+			echo "ERROR: share not set correctly" | tee -a $LOG
+			return 1
+		fi
+	fi
+
+	if [ $(($i % 2)) -eq 0 ]; then
+		grep "guest ok *= *no" $DIR/showshare_out >/dev/null 2>>$LOG
+		if [ "$?" = "1" ]; then
+			echo "ERROR: share not set correctly" | tee -a $LOG
+			return 1
+		fi
+	else
+		grep "guest ok *= *yes" $DIR/showshare_out >/dev/null 2>>$LOG
+		if [ "$?" = "1" ]; then
+			echo "ERROR: share not set correctly" | tee -a $LOG
+			return 1
+		fi
+	fi
+
+	grep "comment *= *test comment" $DIR/showshare_out >/dev/null 2>>$LOG
+	if [ "$?" = "1" ]; then
+		echo "ERROR: share not set correctly" | tee -a $LOG
+		return 1
+	fi
+    done
+
+    echo '\nTaking a conf snapshot for later use' >> $LOG
+    $NETCMD conf list > $DIR/conf_import_in
+    log_print $NETCMD conf list
+    test "x$?" = "x0" || {
+	echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+	return 1
+    }
+}
+
+test_conf_addshare_existing()
+{
+#try adding an already existing share
+    echo '\nAdding an already existing share' >>$LOG
+    $NETCMD conf addshare share1 /tmp "writeable=n" "guest_ok=y" \
+			      "test comment" >>$DIR/addshare_exp \
+					    2>>$DIR/addshare_exp
+    log_print $NETCMD conf addshare share1 /tmp "writeable=n" "guest_ok=y" \
+			      "test comment"
+    test "x$?" = "x255" || {
+	echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+	return 1
+    }
+
+    test -z `cat $DIR/addshare_exp` && {
+	echo "ERROR: addshare output does not match" >> $LOG
+	return 1
+    }
+
+    return 0
+}
+
+test_conf_addshare_usage()
+{
+#check to see if command prints usage
+    echo '\nChecking usage' >>$LOG
+    $NETCMD conf addshare > $DIR/addshare_usage_exp
+    log_print $NETCMD conf addshare
+    test "x$?" = "x255" || {
+	echo 'ERROR: RC does not match, expected: 255' | tee -a $LOG
+	return 1
+    }
+
+    grep "$RPC *conf addshare" $DIR/addshare_usage_exp >/dev/null 2>>$LOG
+    if [ "$?" = "1" ]; then
+	echo "ERROR: no/wrong usage message printed" | tee -a $LOG
+	return 1
+    fi
+}
+
+test_conf_delshare()
+{
+    echo '\nTesting conf delshare' >>$LOG
+    echo ------------------------- >> $LOG
+    echo -n '\n' >> $LOG
+
+    $NETCMD conf delshare share1
+    log_print $NETCMD conf delshare share1
+    test "x$?" = "x0" || {
+	echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+	return 1
+    }
+
+    $NETCMD conf listshares > $DIR/listshares_out
+    log_print $NETCMD conf listshares
+    test "x$?" = "x0" || {
+	echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+	return 1
+    }
+
+    grep "share1$" $DIR/listshares_out >/dev/null 2>>$LOG
+    if [ "$?" = "0" ]; then
+	echo "ERROR: delshare did not delete 'share1'" | tee -a $LOG
+	return 1
+    fi
+}
+
+test_conf_delshare_empty()
+{
+    echo '\nAttempting to delete non_existing share'
+    $NETCMD conf delshare share1
+    log_print $NETCMD conf delshare share1
+    test "x$?" = "x255" || {
+	echo 'ERROR: RC does not match, expected: 255' | tee -a $LOG
+	return 1
+    }
+
+}
+
+test_conf_delshare_usage()
+{
+    echo '\nChecking usage' >>$LOG
+    $NETCMD conf delshare > $DIR/delshare_usage_exp
+    log_print $NETCMD conf delshare
+    test "x$?" = "x255" || {
+	echo 'ERROR: RC does not match, expected: 255' | tee -a $LOG
+	return 1
+    }
+
+    grep "$RPC *conf delshare" $DIR/delshare_usage_exp >/dev/null 2>>$LOG
+    if [ "$?" = "1" ]; then
+	echo "ERROR: no/wrong usage message printed" | tee -a $LOG
+	return 1
+    fi
+}
+
+test_conf_drop()
+{
+
+    echo '\nTesting conf drop' >> $LOG
+    echo ------------------------- >> $LOG
+    echo '\nDropping existing configuration' >> $LOG
+
+    $NETCMD conf drop
+    log_print $NETCMD conf drop
+    test "x$?" = "x0" || {
+	echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+	return 1
+    }
+
+#check to see if listing the configuration yields a blank file
+    $NETCMD conf list 1>>$DIR/list_out
+    log_print $NETCMD conf list
+    test "x$?" = "x0" || {
+	echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+	return 1
+    }
+
+    test -z "`cat $DIR/list_out`" || {
+	echo "ERROR: Expected list output did not match" | tee -a $LOG
+	return 1
+    }
+}
+
+test_conf_drop_empty()
+{
+#Drop an empty config, see if conf drop fails
+    echo '\nAttempting to drop an empty configuration' >>$LOG
+
+    $NETCMD conf drop
+    log_print $NETCMD conf drop
+    test "x$?" = "x0" || {
+	echo 'ERROR: RC does not match, expected: 0' | tee -a $LOG
+	return 1
+    }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list