[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-787-g977cc98

Michael Adam obnox at samba.org
Wed Apr 9 23:33:47 GMT 2008


The branch, v3-2-test has been updated
       via  977cc9898970a0c07c30264e91754740c640e235 (commit)
       via  a1d09f34ec39b614d738c6f795fe8eafaf634105 (commit)
       via  ab51e4d44c3dcd00697c8ffb2ce628c4072c7a53 (commit)
       via  30bc48623cf4f9ee17ff9c3e7a9fd98840a01d92 (commit)
       via  8f2c3efa679d44acc900fb90f03319e830a7dcf4 (commit)
       via  97f9cb857532328999589062ceb0b229bcaf93a3 (commit)
       via  74e87b977514df79e49613a0b1c5157469b3cb93 (commit)
       via  3e81db83707e30ad46a565c9a118e7293b6cdf50 (commit)
       via  fd43a4a1e05a2d259dc75bdcb4c0a3d9d8b41739 (commit)
       via  6641061f76d2175b9476a96d24b99a52163936ca (commit)
       via  757601ec830f4a08c5fdcbe2d9bfac86fdc6602c (commit)
       via  182433be5bae753d264491a3ec97433e2e316d10 (commit)
       via  daef50e54d58a6684b6a890ebf523ca6245f0290 (commit)
       via  0dc1fd68598529891429fb29ab1f561fb434bf38 (commit)
       via  dd543cd30c3eca9621681ba4b6e9a6683ef2bd07 (commit)
       via  5a880c6a2f2415220557a76a9b4ce9a17c766819 (commit)
       via  2c8c65d6900086e92c838333b31abf9efdb61343 (commit)
       via  9bd06d5737aff2bb27c07575285e079fd561a566 (commit)
       via  01c4bd07305b4ce800b99a098652623f118a74aa (commit)
       via  072a3228a4e08894c67ad2983bcea3417e202773 (commit)
       via  23fb33fd33a8287d8691a1a5e95bf160be3ed25c (commit)
       via  798808174d0d4cae3a746e26a253cad1a3177684 (commit)
       via  98151fd3e1c24e5c8aaf3f5132071e91ac6ef257 (commit)
       via  382c623948abd1c6a5cf8ab7ee2be784fcef76ee (commit)
       via  c2d3d56d628f266fdfc0ca98fc199afc01670c2c (commit)
       via  1f64a1b2b4f11b44e9c9584480f01cac066a6a1d (commit)
       via  828c7297247a557ed8e2b6935bbc819aae95a660 (commit)
       via  3fee0d79cc618adc7dd82cfeff62c72ef061017b (commit)
       via  31e68cbe5bdc8d69b2b711ec8ea62dbe612ec68f (commit)
       via  2a4b71b105616b42e1bbfbf01126cc445a991cc0 (commit)
       via  ce1b2f550860cb3a566db09f7c7eac39c195a5b7 (commit)
       via  1ca5afe58cef8b750a65bd8c2a5c9ee794ed50ba (commit)
       via  5e253e10b7f80af1f5a855c8e0f00846853cced1 (commit)
       via  7cfec55ed48644f922ca0ffaa171e3512c93a360 (commit)
       via  94a19234620fc23db9c4aaf449e948342164d1d4 (commit)
       via  8c631ac2f42e984137972b7388add4bcbc199665 (commit)
       via  9f6c909f465df5fc64e2bec88acf272be9cd574e (commit)
       via  bc8dc8626c5fb296edbd193a7cc293317c7a29ca (commit)
       via  ed535b6b30b5c9412803f6373eadc704de6de2f9 (commit)
       via  e86eb375d9f83f73aeea0a16c8b43e2ef21a6e20 (commit)
       via  c65575f831e9929ef7e66f2c7bfeed50f135b4b2 (commit)
       via  c68cd2477c65d5521a713ae0f37cf2994d2c339e (commit)
       via  2ff0b693d7fc7e130a2fb14c06ae8bc28f4b5c57 (commit)
       via  b9e72b402de412c23702715ead96c20e9b3248cc (commit)
       via  b79a33eb2f370b8d8b50ed5ed2a0acc83e711c1e (commit)
       via  4339caff09e1277ae33d3810043bcb3f4e7c4e45 (commit)
       via  bc1a5bdbd3b7da1f85c952579096b3c8dc407572 (commit)
       via  2eb5a681e9e3ff302b5151f25d6856834eae7d54 (commit)
       via  25e0fd84780f4acb80cac3b5f54f9597e0e2f53e (commit)
       via  7af79e60a3060083eae67bd053837c955b3f5c10 (commit)
       via  0e932a0981ef52ff9d236b887eb8177304a99915 (commit)
       via  9890f437264c6acc8c61c430a53c4645e0a12959 (commit)
       via  e0f6a9d50c9b72ec33d4323d1a6c5bdf44d011e7 (commit)
      from  5f6c730cbeddd1ac2f515bd985c08ceb4ca9bc47 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 977cc9898970a0c07c30264e91754740c640e235
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 23:48:45 2008 +0200

    net conf: use talloc and talloc_strdup_lower throughout all net conf functions.
    
    Michael

commit a1d09f34ec39b614d738c6f795fe8eafaf634105
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 23:24:52 2008 +0200

    net conf: implement "net conf delincludes".
    
    usage: "net conf delincludes <servicename>"
    
    This is equivalent to "net conf setincludes <servicename>"
    (without further arguments).
    
    Michael

commit ab51e4d44c3dcd00697c8ffb2ce628c4072c7a53
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 18:46:38 2008 +0200

    net conf: implement a "net conf setincludes" command.
    
    given zero or more filenames as command line parameters
    
    Michael

commit 30bc48623cf4f9ee17ff9c3e7a9fd98840a01d92
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 15:37:33 2008 +0200

    net conf: implement "net conf getincludes".
    
    Michael

commit 8f2c3efa679d44acc900fb90f03319e830a7dcf4
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 15:17:28 2008 +0200

    net conf: add diagnostic message for failure to load text file.
    
    Michael

commit 97f9cb857532328999589062ceb0b229bcaf93a3
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 14:59:05 2008 +0200

    net conf: reduce indentation by grouping testmode code together.
    
    Michael

commit 74e87b977514df79e49613a0b1c5157469b3cb93
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 01:27:30 2008 +0200

    net conf: don't drop config in testmode
    
    Michael

commit 3e81db83707e30ad46a565c9a118e7293b6cdf50
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 01:20:36 2008 +0200

    net conf: fix import to correctly add includes (at the end)
    
    Michael

commit fd43a4a1e05a2d259dc75bdcb4c0a3d9d8b41739
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 01:28:43 2008 +0200

    loadparm: drop debug level in map_parameter from 0 to 1
    
    we don't want to see this all the times in tests.
    
    Michael

commit 6641061f76d2175b9476a96d24b99a52163936ca
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 12:08:18 2008 +0200

    test: run smbconftort testsuite from the local_s3 tests
    
    Michael

commit 757601ec830f4a08c5fdcbe2d9bfac86fdc6602c
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 22:23:12 2008 +0200

    libsmbconf: testsuite: add test for delete_includes
    
    Michael

commit 182433be5bae753d264491a3ec97433e2e316d10
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 22:22:20 2008 +0200

    libsmbconf: return success and count 0 from get_includes when no includes present.
    
    Michael

commit daef50e54d58a6684b6a890ebf523ca6245f0290
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 22:21:15 2008 +0200

    libsmbconf: add delete_includes mehtod to the api (and backend implementations)
    
    Michael

commit 0dc1fd68598529891429fb29ab1f561fb434bf38
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 18:46:02 2008 +0200

    libsmbconf: let set_includes delete the includes paramter when given an empty list
    
    instead of complaining
    
    Michael

commit dd543cd30c3eca9621681ba4b6e9a6683ef2bd07
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 15:16:45 2008 +0200

    libsmbconf: fix crashbug - correctly check for existence of file.
    
    Michael

commit 5a880c6a2f2415220557a76a9b4ce9a17c766819
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 09:54:17 2008 +0200

    libsmbconf: prevent getting/deleting value "includes".
    
    This has to be handled differently (by using get_includes / set_includes)
    
    Michael

commit 2c8c65d6900086e92c838333b31abf9efdb61343
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 01:19:50 2008 +0200

    libsmbconf: consider "include" a forbidden parameter in regisry config again.
    
    It is now taken care of by the special includes handling.
    
    Michael

commit 9bd06d5737aff2bb27c07575285e079fd561a566
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 00:47:27 2008 +0200

    libsmbconf: add includes at the end of parameter list in reg_get_share().
    
    Michael

commit 01c4bd07305b4ce800b99a098652623f118a74aa
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 9 00:05:45 2008 +0200

    libsmbconf: add function smbconf_reg_valname_valid() and use it in get_values()
    
    so "includes" doesn't get listed as a parameter
    
    Michael

commit 072a3228a4e08894c67ad2983bcea3417e202773
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 23:58:56 2008 +0200

    libsmbconf: refactor get_includes on opened key into smbconf_reg_get_includes_internal()
    
    Michael

commit 23fb33fd33a8287d8691a1a5e95bf160be3ed25c
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 22:57:48 2008 +0200

    libsmbconf: rename registry_smbconf_valname_forbidden() to smbconf_reg_valname_forbidden()
    
    Michael

commit 798808174d0d4cae3a746e26a253cad1a3177684
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 22:56:06 2008 +0200

    libsmbconf: make registry_smbconf_valname_forbidden() static
    
    Michael

commit 98151fd3e1c24e5c8aaf3f5132071e91ac6ef257
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 22:51:02 2008 +0200

    libsmbconf: move registry_smbconf_valname_forbidden() to the registry backend
    
    from util_reg.c - no other callers left
    
    Michael

commit 382c623948abd1c6a5cf8ab7ee2be784fcef76ee
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 22:23:57 2008 +0200

    libsmbconf: more sanely print multi_sz values in registry backend
    
    Michael

commit c2d3d56d628f266fdfc0ca98fc199afc01670c2c
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 18:00:27 2008 +0200

    libsmbconf: testsuite: fix handling of error message/overall status
    
    Michael

commit 1f64a1b2b4f11b44e9c9584480f01cac066a6a1d
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 17:54:29 2008 +0200

    libsmbconf: testsuite: add test_set_get_includes() and use it in registry test
    
    Michael

commit 828c7297247a557ed8e2b6935bbc819aae95a660
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 17:49:10 2008 +0200

    libsmbconf: testsuite: refactor printing of string lists out.
    
    Michael

commit 3fee0d79cc618adc7dd82cfeff62c72ef061017b
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 17:46:36 2008 +0200

    libsmbconf: implement get_includes() and set_includes() for registry backend.
    
    includes are stored per share in a special registry value "includes"
    of type multi_sz.
    
    Michael

commit 31e68cbe5bdc8d69b2b711ec8ea62dbe612ec68f
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 14:31:16 2008 +0200

    libsmbconf: testsuite: test get_includes for registry backend
    
    Michael

commit 2a4b71b105616b42e1bbfbf01126cc445a991cc0
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 14:30:46 2008 +0200

    libsmbconf: testsuite: use the get_global_includes in get_includes test.
    
    Michael

commit ce1b2f550860cb3a566db09f7c7eac39c195a5b7
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 14:24:42 2008 +0200

    libsmbconf: add "_global_" wrappers for get/set_includes.
    
    These use the usual global_check like the other global wrappers.
    
    Michael

commit 1ca5afe58cef8b750a65bd8c2a5c9ee794ed50ba
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 12:30:21 2008 +0200

    libsmbconf: testsuite: add test for "get_includes" and use it in the text backend test.
    
    Michael

commit 5e253e10b7f80af1f5a855c8e0f00846853cced1
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 12:09:24 2008 +0200

    libsmbconf: fill get_includes() in text backed to retrieve includes from cache.
    
    Michael

commit 7cfec55ed48644f922ca0ffaa171e3512c93a360
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 17:53:45 2008 +0200

    libsmbconf: testsuite: set the debufg fd to stderr.
    
    ...so that we see some debug output
    
    Michael

commit 94a19234620fc23db9c4aaf449e948342164d1d4
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 17:52:46 2008 +0200

    libsmbconf: testsuite: use POPT_COMMON_SAMBA instead of POPT_COMMON_CONFIGFILE
    
    so we can for instance set the debug level on the command line.
    
    Michael

commit 8c631ac2f42e984137972b7388add4bcbc199665
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 17:51:57 2008 +0200

    libsmbconf: testsuite: add talloc_stackframe to main().
    
    Michael

commit 9f6c909f465df5fc64e2bec88acf272be9cd574e
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 12:07:35 2008 +0200

    libsmbconf: testsuite: add support for "--configfile" option.
    
    Michael

commit bc8dc8626c5fb296edbd193a7cc293317c7a29ca
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 11:02:17 2008 +0200

    libsmbconf: add testsuite to the library.
    
    Currently only the init function is tested, more tests to come...
    
    Michael

commit ed535b6b30b5c9412803f6373eadc704de6de2f9
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 10:16:03 2008 +0200

    libsmbconf: add talloc context to the get_includes methods.
    
    Michael

commit e86eb375d9f83f73aeea0a16c8b43e2ef21a6e20
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 01:56:32 2008 +0200

    libsmbconf: add get_includes() and set_includes() to the API.
    
    Includes have to get a special treatment, at least for registry.
    Includes are not like other smbconf parameters: they are some kind
    of metainformation. "include" has two effects when stated twice so
    it can not be stored boldly into registry, since there can only be
    one value named "include" in registry per key.
    
    I will provide special handling for includes for the registry backend.
    
    This patch provides the necessary methods in the smbconf API.
    
    Michael

commit c65575f831e9929ef7e66f2c7bfeed50f135b4b2
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 22:49:11 2008 +0200

    libsmbconf: activate the verbatim-flag in text backend: store parameters as they come.
    
    with verbatim == true, parameters are stored as they come from the input file,
    duplicates are listed multiple times, etc.
    
    Michael

commit c68cd2477c65d5521a713ae0f37cf2994d2c339e
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 22:43:33 2008 +0200

    libsmbconf: pass txt_private_data instead of only cache to do_parameter/section
    
    in preparation of using the verbatim flag.
    
    Michael

commit 2ff0b693d7fc7e130a2fb14c06ae8bc28f4b5c57
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 23:28:48 2008 +0200

    libsmbconf: load file after special initialization
    
    otherwise verbatim parameter can have no effect.
    
    Michael

commit b9e72b402de412c23702715ead96c20e9b3248cc
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 22:33:01 2008 +0200

    libsmbconf: add a "verbatim" parameter to smbconf_init_txt_simple().
    
    Michael

commit b79a33eb2f370b8d8b50ed5ed2a0acc83e711c1e
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 15:29:11 2008 +0200

    libsmbconf: reformat smbconf_format_registry_value() - indentations/tabs
    
    Michael

commit 4339caff09e1277ae33d3810043bcb3f4e7c4e45
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 15:15:57 2008 +0200

    libsmbconf: untangle assignment and test in for-loop condition.
    
    Michael

commit bc1a5bdbd3b7da1f85c952579096b3c8dc407572
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 15:12:44 2008 +0200

    libsmbconf: fix a comment
    
    Michael

commit 2eb5a681e9e3ff302b5151f25d6856834eae7d54
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 00:08:41 2008 +0200

    libsmbconf: search from the back when getting parameter from text backend
    
    so we make sure to always deliver the value last read.
    
    Michael

commit 25e0fd84780f4acb80cac3b5f54f9597e0e2f53e
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 8 00:03:39 2008 +0200

    libsmbconf: add smbconf_reverse_find_in_array() to find last occurence of a string.
    
    Michael

commit 7af79e60a3060083eae67bd053837c955b3f5c10
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 15:09:28 2008 +0200

    libsmbconf: move smbconf_find_in_array() to smbconf_util.c
    
    Michael

commit 0e932a0981ef52ff9d236b887eb8177304a99915
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 15:06:41 2008 +0200

    libsmbconf: reorder prototypes in smbconf_private.h
    
    Michael

commit 9890f437264c6acc8c61c430a53c4645e0a12959
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 15:05:33 2008 +0200

    libsmbconf: rename smbconf_txt_find_in_array() to smbconf_find_in_array()
    
    Michael

commit e0f6a9d50c9b72ec33d4323d1a6c5bdf44d011e7
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 7 15:01:44 2008 +0200

    libsmbconf: move utility functions from main module to new smbconf_util.c
    
    Michael

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

Summary of changes:
 source/Makefile.in                      |   28 +++-
 source/lib/smbconf/smbconf.c            |  166 ++++++++---------
 source/lib/smbconf/smbconf.h            |   18 ++-
 source/lib/smbconf/smbconf_private.h    |   19 ++-
 source/lib/smbconf/smbconf_reg.c        |  302 ++++++++++++++++++++++++++++---
 source/lib/smbconf/smbconf_txt_simple.c |  166 ++++++++++++-----
 source/lib/smbconf/smbconf_util.c       |  145 +++++++++++++++
 source/lib/smbconf/testsuite.c          |  283 +++++++++++++++++++++++++++++
 source/lib/util_reg.c                   |   22 ---
 source/param/loadparm.c                 |    2 +-
 source/script/tests/test_local_s3.sh    |    3 +
 source/utils/net_conf.c                 |  271 ++++++++++++++++++++++++---
 12 files changed, 1207 insertions(+), 218 deletions(-)
 create mode 100644 source/lib/smbconf/smbconf_util.c
 create mode 100644 source/lib/smbconf/testsuite.c


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index 5241801..0fe0b5d 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -208,7 +208,8 @@ TORTURE_PROGS = bin/smbtorture at EXEEXT@ bin/msgtest at EXEEXT@ \
 	bin/masktest at EXEEXT@ bin/locktest at EXEEXT@ \
 	bin/locktest2 at EXEEXT@ bin/nsstest at EXEEXT@ bin/vfstest at EXEEXT@ \
 	bin/pdbtest at EXEEXT@ bin/talloctort at EXEEXT@ bin/replacetort at EXEEXT@ \
-	bin/tdbtorture at EXEEXT@
+	bin/tdbtorture at EXEEXT@ \
+	bin/smbconftort at EXEEXT@
 
 BIN_PROGS = @EXTRA_BIN_PROGS@ \
 	$(BIN_PROGS1) $(BIN_PROGS2) $(BIN_PROGS3) $(BIN_PROGS4) 
@@ -830,9 +831,22 @@ LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
 		 $(SECRETS_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ) \
 		 $(DCUTIL_OBJ) $(LIBADS_OBJ) $(PRIVILEGES_BASIC_OBJ)
 
-LIBSMBCONF_OBJ = lib/smbconf/smbconf.o lib/smbconf/smbconf_reg.o \
+LIBSMBCONF_OBJ = lib/smbconf/smbconf.o lib/smbconf/smbconf_util.o \
+		 lib/smbconf/smbconf_reg.o \
 		 lib/smbconf/smbconf_txt_simple.o
 
+SMBCONFTORT_OBJ0 = lib/smbconf/testsuite.o
+
+SMBCONFTORT_OBJ = $(SMBCONFTORT_OBJ0) \
+		  $(LIB_NONSMBD_OBJ) \
+		  $(PARAM_OBJ) \
+		  $(ERRORMAP_OBJ) \
+		  $(RPC_PARSE_OBJ1) \
+		  $(LIBSAMBA_OBJ) \
+		  $(DOSERR_OBJ) \
+		  $(SECRETS_OBJ) \
+		  $(POPT_LIB_OBJ)
+
 LIBNET_OBJ = libnet/libnet_join.o \
 	     librpc/gen_ndr/ndr_libnet_join.o
 
@@ -1155,6 +1169,8 @@ talloctort : SHOWFLAGS bin/talloctort at EXEEXT@
 
 replacetort : SHOWFLAGS bin/replacetort at EXEEXT@
 
+smbconftort : SHOWFLAGS bin/smbconftort at EXEEXT@
+
 timelimit : SHOWFLAGS bin/timelimit at EXEEXT@
 
 nsswitch : SHOWFLAGS bin/winbindd at EXEEXT@ bin/wbinfo at EXEEXT@ @WINBIND_NSS@ \
@@ -1180,7 +1196,7 @@ idl:
 #####################################################################
 
 
-everything: all libtalloc libsmbclient libnetapi debug2html smbfilter talloctort replacetort modules torture \
+everything: all libtalloc libsmbclient libnetapi debug2html smbfilter talloctort replacetort smbconftort modules torture \
 	$(EVERYTHING_PROGS)
 
 .SUFFIXES:
@@ -1413,6 +1429,12 @@ bin/replacetort at EXEEXT@: $(REPLACETORT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@
 	@$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(REPLACETORT_OBJ) $(LDFLAGS) \
 		$(DYNEXP) $(LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@
 
+bin/smbconftort at EXEEXT@: $(SMBCONFTORT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
+	@echo Linking $@
+	@$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBCONFTORT_OBJ) $(LDFLAGS) \
+		$(DYNEXP) $(LIBS) $(LDAP_LIBS) @POPTLIBS@ \
+		@LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+
 bin/masktest at EXEEXT@: $(BINARY_PREREQS) $(MASKTEST_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
 	@echo Linking $@
 	@$(CC) $(FLAGS) -o $@ $(MASKTEST_OBJ) $(LDFLAGS) $(DYNEXP) \
diff --git a/source/lib/smbconf/smbconf.c b/source/lib/smbconf/smbconf.c
index 4315dd9..541b163 100644
--- a/source/lib/smbconf/smbconf.c
+++ b/source/lib/smbconf/smbconf.c
@@ -1,6 +1,6 @@
 /*
  *  Unix SMB/CIFS implementation.
- *  libnet smbconf registry Support
+ *  libsmbconf - Samba configuration library
  *  Copyright (C) Michael Adam 2007-2008
  *  Copyright (C) Guenther Deschner 2007
  *
@@ -27,11 +27,6 @@
  *
  **********************************************************************/
 
-static int smbconf_destroy_ctx(struct smbconf_ctx *ctx)
-{
-	return ctx->ops->shutdown(ctx);
-}
-
 static WERROR smbconf_global_check(struct smbconf_ctx *ctx)
 {
 	if (!smbconf_share_exists(ctx, GLOBAL_NAME)) {
@@ -43,89 +38,6 @@ static WERROR smbconf_global_check(struct smbconf_ctx *ctx)
 
 /**********************************************************************
  *
- * helper functions exported to the backend modules
- * (might go into a smbconf_util.c)
- *
- **********************************************************************/
-
-/**
- * add a string to a talloced array of strings.
- */
-WERROR smbconf_add_string_to_array(TALLOC_CTX *mem_ctx,
-				   char ***array,
-				   uint32_t count,
-				   const char *string)
-{
-	char **new_array = NULL;
-
-	if ((array == NULL) || (string == NULL)) {
-		return WERR_INVALID_PARAM;
-	}
-
-	new_array = TALLOC_REALLOC_ARRAY(mem_ctx, *array, char *, count + 1);
-	if (new_array == NULL) {
-		return WERR_NOMEM;
-	}
-
-	new_array[count] = talloc_strdup(new_array, string);
-	if (new_array[count] == NULL) {
-		TALLOC_FREE(new_array);
-		return WERR_NOMEM;
-	}
-
-	*array = new_array;
-
-	return WERR_OK;
-}
-
-/**
- * Initialize the configuration.
- *
- * This should be the first function in a sequence of calls to smbconf
- * functions:
- *
- * Upon success, this creates and returns the conf context
- * that should be passed around in subsequent calls to the other
- * smbconf functions.
- *
- * After the work with the configuration is completed, smbconf_shutdown()
- * should be called.
- */
-WERROR smbconf_init(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
-		    const char *path, struct smbconf_ops *ops)
-{
-	WERROR werr = WERR_OK;
-	struct smbconf_ctx *ctx;
-
-	if (conf_ctx == NULL) {
-		return WERR_INVALID_PARAM;
-	}
-
-	ctx = TALLOC_ZERO_P(mem_ctx, struct smbconf_ctx);
-	if (ctx == NULL) {
-		return WERR_NOMEM;
-	}
-
-	ctx->ops = ops;
-
-	werr = ctx->ops->init(ctx, path);
-	if (!W_ERROR_IS_OK(werr)) {
-		goto fail;
-	}
-
-	talloc_set_destructor(ctx, smbconf_destroy_ctx);
-
-	*conf_ctx = ctx;
-	return werr;
-
-fail:
-	TALLOC_FREE(ctx);
-	return werr;
-}
-
-
-/**********************************************************************
- *
  * The actual libsmbconf API functions that are exported.
  *
  **********************************************************************/
@@ -423,3 +335,79 @@ WERROR smbconf_delete_global_parameter(struct smbconf_ctx *ctx,
 
 	return werr;
 }
+
+WERROR smbconf_get_includes(struct smbconf_ctx *ctx,
+			    TALLOC_CTX *mem_ctx,
+			    const char *service,
+			    uint32_t *num_includes, char ***includes)
+{
+	if (!smbconf_share_exists(ctx, service)) {
+		return WERR_NO_SUCH_SERVICE;
+	}
+
+	return ctx->ops->get_includes(ctx, mem_ctx, service, num_includes,
+				      includes);
+}
+
+WERROR smbconf_get_global_includes(struct smbconf_ctx *ctx,
+				   TALLOC_CTX *mem_ctx,
+				   uint32_t *num_includes, char ***includes)
+{
+	WERROR werr;
+
+	werr = smbconf_global_check(ctx);
+	if (W_ERROR_IS_OK(werr)) {
+		werr = smbconf_get_includes(ctx, mem_ctx, GLOBAL_NAME,
+					    num_includes, includes);
+	}
+
+	return werr;
+}
+
+WERROR smbconf_set_includes(struct smbconf_ctx *ctx,
+			    const char *service,
+			    uint32_t num_includes, const char **includes)
+{
+	if (!smbconf_share_exists(ctx, service)) {
+		return WERR_NO_SUCH_SERVICE;
+	}
+
+	return ctx->ops->set_includes(ctx, service, num_includes, includes);
+}
+
+WERROR smbconf_set_global_includes(struct smbconf_ctx *ctx,
+				   uint32_t num_includes,
+				   const char **includes)
+{
+	WERROR werr;
+
+	werr = smbconf_global_check(ctx);
+	if (W_ERROR_IS_OK(werr)) {
+		werr = smbconf_set_includes(ctx, GLOBAL_NAME,
+					    num_includes, includes);
+	}
+
+	return werr;
+}
+
+
+WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service)
+{
+	if (!smbconf_share_exists(ctx, service)) {
+		return WERR_NO_SUCH_SERVICE;
+	}
+
+	return ctx->ops->delete_includes(ctx, service);
+}
+
+WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx)
+{
+	WERROR werr;
+
+	werr = smbconf_global_check(ctx);
+	if (W_ERROR_IS_OK(werr)) {
+		werr = smbconf_delete_includes(ctx, GLOBAL_NAME);
+	}
+
+	return werr;
+}
diff --git a/source/lib/smbconf/smbconf.h b/source/lib/smbconf/smbconf.h
index 72729b9..ee7549a 100644
--- a/source/lib/smbconf/smbconf.h
+++ b/source/lib/smbconf/smbconf.h
@@ -40,7 +40,8 @@ WERROR smbconf_init_reg(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
 
 WERROR smbconf_init_txt_simple(TALLOC_CTX *mem_ctx,
 			       struct smbconf_ctx **conf_ctx,
-			       const char *path);
+			       const char *path,
+			       bool verbatim);
 
 /*
  * the smbconf API functions
@@ -85,5 +86,20 @@ WERROR smbconf_delete_parameter(struct smbconf_ctx *ctx,
 				const char *service, const char *param);
 WERROR smbconf_delete_global_parameter(struct smbconf_ctx *ctx,
 				       const char *param);
+WERROR smbconf_get_includes(struct smbconf_ctx *ctx,
+			    TALLOC_CTX *mem_ctx,
+			    const char *service,
+			    uint32_t *num_includes, char ***includes);
+WERROR smbconf_get_global_includes(struct smbconf_ctx *ctx,
+				   TALLOC_CTX *mem_ctx,
+				   uint32_t *num_includes, char ***includes);
+WERROR smbconf_set_includes(struct smbconf_ctx *ctx,
+			    const char *service,
+			    uint32_t num_includes, const char **includes);
+WERROR smbconf_set_global_includes(struct smbconf_ctx *ctx,
+				   uint32_t num_includes,
+				   const char **includes);
+WERROR smbconf_delete_includes(struct smbconf_ctx *ctx, const char *service);
+WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx);
 
 #endif /*  _LIBSMBCONF_H_  */
diff --git a/source/lib/smbconf/smbconf_private.h b/source/lib/smbconf/smbconf_private.h
index e08a2b1..5acba5a 100644
--- a/source/lib/smbconf/smbconf_private.h
+++ b/source/lib/smbconf/smbconf_private.h
@@ -51,6 +51,15 @@ struct smbconf_ops {
 				char **valstr);
 	WERROR (*delete_parameter)(struct smbconf_ctx *ctx,
 				   const char *service, const char *param);
+	WERROR (*get_includes)(struct smbconf_ctx *ctx,
+			       TALLOC_CTX *mem_ctx,
+			       const char *service,
+			       uint32_t *num_includes, char ***includes);
+	WERROR (*set_includes)(struct smbconf_ctx *ctx,
+			       const char *service,
+			       uint32_t num_includes, const char **includes);
+	WERROR (*delete_includes)(struct smbconf_ctx *ctx,
+				  const char *service);
 };
 
 struct smbconf_ctx {
@@ -59,12 +68,18 @@ struct smbconf_ctx {
 	void *data; /* private data for use in backends */
 };
 
+WERROR smbconf_init(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
+		    const char *path, struct smbconf_ops *ops);
+
 WERROR smbconf_add_string_to_array(TALLOC_CTX *mem_ctx,
 				   char ***array,
 				   uint32_t count,
 				   const char *string);
 
-WERROR smbconf_init(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
-		    const char *path, struct smbconf_ops *ops);
+bool smbconf_find_in_array(const char *string, char **list,
+			   uint32_t num_entries, uint32_t *entry);
+
+bool smbconf_reverse_find_in_array(const char *string, char **list,
+				   uint32_t num_entries, uint32_t *entry);
 
 #endif
diff --git a/source/lib/smbconf/smbconf_reg.c b/source/lib/smbconf/smbconf_reg.c
index b40c37e..0ac49a7 100644
--- a/source/lib/smbconf/smbconf_reg.c
+++ b/source/lib/smbconf/smbconf_reg.c
@@ -20,6 +20,8 @@
 #include "includes.h"
 #include "smbconf_private.h"
 
+#define INCLUDES_VALNAME "includes"
+
 struct reg_private_data {
 	NT_USER_TOKEN *token;
 	bool open;		/* did _we_ open the registry? */
@@ -39,6 +41,35 @@ static struct reg_private_data *rpd(struct smbconf_ctx *ctx)
 	return (struct reg_private_data *)(ctx->data);
 }
 
+/*
+ * check whether a given value name is forbidden in registry (smbconf)
+ */
+static bool smbconf_reg_valname_forbidden(const char *valname)
+{
+	/* hard code the list of forbidden names here for now */
+	const char *forbidden_valnames[] = {
+		"lock directory",
+		"lock dir",
+		"config backend",
+		"include",
+		NULL
+	};
+	const char **forbidden = NULL;
+
+	for (forbidden = forbidden_valnames; *forbidden != NULL; forbidden++) {
+		if (strwicmp(valname, *forbidden) == 0) {
+			return true;
+		}
+	}
+	return false;
+}
+
+static bool smbconf_reg_valname_valid(const char *valname)
+{
+	return (lp_parameter_is_valid(valname) &&
+		!smbconf_reg_valname_forbidden(valname));
+}
+
 /**
  * Open a registry key specified by "path"
  */
@@ -220,7 +251,7 @@ static WERROR smbconf_reg_set_value(struct registry_key *key,
 		goto done;
 	}
 
-	if (registry_smbconf_valname_forbidden(canon_valname)) {
+	if (smbconf_reg_valname_forbidden(canon_valname)) {
 		DEBUG(5, ("Parameter '%s' not allowed in registry.\n",
 			  canon_valname));
 		werr = WERR_INVALID_PARAM;
@@ -262,6 +293,51 @@ done:
 	return werr;
 }
 
+static WERROR smbconf_reg_set_multi_sz_value(struct registry_key *key,
+					     const char *valname,
+					     const uint32_t num_strings,
+					     const char **strings)
+{
+	WERROR werr;
+	struct registry_value *value;
+	uint32_t count;
+	TALLOC_CTX *tmp_ctx = talloc_stackframe();
+
+	if (strings == NULL) {
+		werr = WERR_INVALID_PARAM;
+		goto done;
+	}
+
+	value = TALLOC_ZERO_P(tmp_ctx, struct registry_value);
+
+	value->type = REG_MULTI_SZ;
+	value->v.multi_sz.num_strings = num_strings;
+	value->v.multi_sz.strings = TALLOC_ARRAY(tmp_ctx, char *, num_strings);
+	if (value->v.multi_sz.strings == NULL) {
+		werr = WERR_NOMEM;
+		goto done;
+	}
+	for (count = 0; count < num_strings; count++) {
+		value->v.multi_sz.strings[count] =
+			talloc_strdup(value->v.multi_sz.strings,
+				      strings[count]);
+		if (value->v.multi_sz.strings[count] == NULL) {
+			werr = WERR_NOMEM;
+			goto done;
+		}
+	}
+
+	werr = reg_setvalue(key, valname, value);
+	if (!W_ERROR_IS_OK(werr)) {
+		DEBUG(5, ("Error adding value '%s' to key '%s': %s\n",
+			  valname, key->key->name, dos_errstr(werr)));
+	}
+
+done:
+	TALLOC_FREE(tmp_ctx);
+	return werr;
+}
+
 /**
  * format a registry_value into a string.
  *
@@ -288,28 +364,85 @@ static char *smbconf_format_registry_value(TALLOC_CTX *mem_ctx,
 		result = talloc_asprintf(mem_ctx, "%s", value->v.sz.str);
 		break;
 	case REG_MULTI_SZ: {
-                uint32 j;
-                for (j = 0; j < value->v.multi_sz.num_strings; j++) {
-                        result = talloc_asprintf(mem_ctx, "%s \"%s\" ",
-						 result,
+		uint32 j;
+		for (j = 0; j < value->v.multi_sz.num_strings; j++) {
+			result = talloc_asprintf(mem_ctx, "%s\"%s\" ",
+						 result ? result : "" ,
 						 value->v.multi_sz.strings[j]);
 			if (result == NULL) {
 				break;
 			}
-                }
-                break;
-        }
+		}
+		break;
+	}
 	case REG_BINARY:
-                result = talloc_asprintf(mem_ctx, "binary (%d bytes)",
+		result = talloc_asprintf(mem_ctx, "binary (%d bytes)",
 					 (int)value->v.binary.length);
-                break;
-        default:
-                result = talloc_asprintf(mem_ctx, "<unprintable>");
-                break;
-        }
+		break;
+	default:
+		result = talloc_asprintf(mem_ctx, "<unprintable>");
+		break;
+	}
 	return result;
 }
 
+static WERROR smbconf_reg_get_includes_internal(TALLOC_CTX *mem_ctx,
+						struct registry_key *key,
+						uint32_t *num_includes,
+						char ***includes)
+{
+	WERROR werr;
+	uint32_t count;
+	struct registry_value *value = NULL;
+	char **tmp_includes = NULL;
+	TALLOC_CTX *tmp_ctx = talloc_stackframe();
+
+	if (!smbconf_value_exists(key, INCLUDES_VALNAME)) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list