[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-0pre2-216-gd478388

Karolin Seeger kseeger at samba.org
Thu Mar 27 07:39:05 GMT 2008


The branch, v3-2-stable has been updated
       via  d47838897a30c85db268a7424cb90d3d0ee3acac (commit)
       via  577283c0a8a3aee5f46ad4851031632f011ae762 (commit)
       via  645817b3de5ea762a0a4f547404cadab0d941735 (commit)
       via  b6ee19725e7397b775b0b96d0463a3410e1af6ed (commit)
       via  66c273ea7149d5d921a9f6a3cee600b80b92d0af (commit)
       via  388a70064c48d40bdf7e1c0909222f8c076d2896 (commit)
       via  9fc1b422fee98e28123d8727ccb68affb8c0e4bf (commit)
       via  e154a5847aa07aa54a1ee83a8585ae38f3faa1b1 (commit)
       via  27be80c02c1c4f6340212a364ab867770c70377d (commit)
       via  ad66f5df6a0c10bd0ed92a14643dbad31ff00c28 (commit)
       via  a50cac83d03442e7894b68eb21a21df964930647 (commit)
       via  a0e8e74a11ca2ca3c63f52758ebb6cd4933196b0 (commit)
       via  23d95324b506439835fb65cf18eb10fd2ddafd83 (commit)
       via  dfbad488ae4e8ceb5b04c4d4687caf3de86c620b (commit)
       via  56e3660e4072d6bc6e69f0bcdc201dd28329327d (commit)
       via  54f3133d52c0b5f1dff324f263a91a8a973de34f (commit)
       via  26df11aca3fb448694dcd58cb0b74eae48f4e470 (commit)
       via  8381866d0789343c4dc88b84ba1e9c70ca69595b (commit)
       via  942fc35b0b445a517f43b2827c38107c1dd3757e (commit)
       via  153ec9d63c918f84b270b2d9fa8ecc03fd3658ba (commit)
       via  ec8146433a4f262795628499838704f605b98110 (commit)
       via  cb4dd308ec22148588da4e708527d40f62938949 (commit)
       via  f1f74de5cc35380ddf6ab60d924bf47b5060758b (commit)
       via  10acd27eff9ed5c2bc52cdd7615a66a5b500a836 (commit)
       via  55e4d8f08b52086e137e16d03612058be0503fff (commit)
       via  8de8bb35eedc0a719e3d2043bf6e81f63ee0c641 (commit)
       via  57498e81d623977868c004648649ea134c9de4f0 (commit)
       via  6ac9588360798520f0dc658923963315732f7654 (commit)
       via  fc94697d399d6e86ae76d9f33ad30ecd79c15852 (commit)
       via  5623cbc2f5c91679123e266646ecf1d36ffc82ad (commit)
       via  160f6b13bec74fc2a99bc68dc1b6a391ba03561a (commit)
       via  35fcc34bdb5d6a82d9f20052712ea121f705f654 (commit)
       via  f1df31dad223c7c875152c67c286376c834dca12 (commit)
       via  b6312361afea3629bccfca22b655c0dd4127816e (commit)
       via  5942995b27621bb6685415848976bd8db96c9cde (commit)
       via  dec6e3377577f6b9fced33c36273407d4465b73c (commit)
       via  735f97fdfb68a5cafe11a2d288b8e2e8fca1c162 (commit)
       via  a7e1479d380931d74975d2fe39222fca2cc8e123 (commit)
       via  1c7d4e946122fcaef7db4de152e9a88d34eec925 (commit)
       via  a7c3ab80513519e0aca9da6631d8141011434415 (commit)
       via  ac3bfa12281658add7a5e998958382f9c105f313 (commit)
       via  a340bfbe5b41aa2ebf2c81afbe52e87a0d91065f (commit)
       via  8fbcccc4be4476a25307c1d288bf7755f0f71719 (commit)
       via  6947da86635fd40f0be6402eb5e3670d87c07d8d (commit)
       via  5c409e3db49d1c7ccbd9bd759f585455efcdbaa2 (commit)
       via  00ff462828c5ab96835bdaf5a98bff9a33a5dc03 (commit)
       via  912717178b565c4ea9000f766e2ec0f3a799e1c1 (commit)
       via  51bdee01edc096c48d1404f6c7e5ceeeea65d423 (commit)
       via  f67d05d2de65a63c0226e51324e269218c3d55a5 (commit)
       via  3dd9e3610b00c0bd4458168d88f611a511f580af (commit)
       via  17d2173dc3e539593e559a897983cbe9658f221b (commit)
       via  8099df79b624e9a4e36352a25a73f1f08b2d9b0c (commit)
       via  5fd73bf80f7c1f23cd0dad56adcc4e90e4abe956 (commit)
       via  36763920456164c475a16da95184528e1454ef83 (commit)
       via  6bbedaf8f463d39351d1aca42333e3e99d023f13 (commit)
       via  95b82e64142210c41247ec91669ba5fac6afd45e (commit)
       via  9901c1675a206a0b842429d5e7321844d96bc2ce (commit)
       via  c5b654d146996102278a0f355e838ac827e0649f (commit)
       via  e4599a5297333d19af16da15e55b170cc6e53466 (commit)
       via  c1dd4a2caa4bf9d785401942ec83e9cd796e47df (commit)
       via  8fbaa074621836e8baee7daab764bc91f8589ec8 (commit)
       via  10107e3d5f92aeb70d66b5b311f8dc542e88b761 (commit)
       via  2c608b8309c385d5c0f3017d6d709e4fbc72808a (commit)
       via  631d03f3aa4a77bb8372acf11c0a825498283e86 (commit)
       via  3c038ec0bb36cc02f73f2fc64b77e56a4e9b4960 (commit)
       via  a76637f989c5671f286df2657c4f6ec4e4f0a2ca (commit)
       via  0382fb2e2585a8b92363f9378338b37d505413d1 (commit)
       via  c58deefeffa73b84a213baf7601cada498fb83c9 (commit)
       via  659b33c498fa42176f000386168e6b34802689e6 (commit)
       via  dbafde6502996fb7e4500ca0bf7f431abf51153a (commit)
       via  41e582e1157bc4a44f86a46d044acfa5081eb09f (commit)
       via  34cd00dcaaedb554fdf32a70c6aa6e0f0dad3d5e (commit)
       via  b032f1cc445f02f0232e99627a23ee5d03bb7ce8 (commit)
      from  0247bc5d72809c8d4a59abb105417b0399a64746 (commit)

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


- Log -----------------------------------------------------------------
commit d47838897a30c85db268a7424cb90d3d0ee3acac
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 27 00:32:00 2008 +0100

    net_conf: fix non-testmode import function.
    
    Michael
    (cherry picked from commit cd17cc745a35db8ee158f59a5fff1f0f26cf9c6e)

commit 577283c0a8a3aee5f46ad4851031632f011ae762
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 23:58:52 2008 +0100

    libsmbconf: text - pass the cache instead of all private data to pm_process.
    
    Michael
    (cherry picked from commit ee46f0eca6ea21d0c51103252fecf911bb448687)

commit 645817b3de5ea762a0a4f547404cadab0d941735
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 23:58:01 2008 +0100

    libsmbconf: text - change the cache to be talloced
    
    instead of having it directly as a member in the private data struct.
    This makes it easier to flush and initialize the cache.
    
    Michael
    (cherry picked from commit 03efb72b4632e2bbb0838ca56a3e556448bda5c5)

commit b6ee19725e7397b775b0b96d0463a3410e1af6ed
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 23:11:04 2008 +0100

    libsmbconf: in text backend, put flushing of the cache into a helper function.
    
    And use it also in the close operation.
    
    Michael
    (cherry picked from commit 8cb288124993eb59459e7e9777c65e58c0554d55)

commit 66c273ea7149d5d921a9f6a3cee600b80b92d0af
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 14:46:43 2008 +0100

    net_conf: reformat - re-indent one function call.
    
    Michael
    (cherry picked from commit 9ef9d4c4e77523d7f3cc5fdac199559896e585bd)

commit 388a70064c48d40bdf7e1c0909222f8c076d2896
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 14:45:34 2008 +0100

    net_conf: add casts to avoid compiler warnings.
    
    Michael
    (cherry picked from commit 1c6b9a0ac34c4a7b4e000300db8dffdbb09fe7da)

commit 9fc1b422fee98e28123d8727ccb68affb8c0e4bf
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 14:39:02 2008 +0100

    net_conf: rename "ctx" to "mem_ctx" for clarity.
    
    There are also smbconf contexts arount...
    
    Michael
    (cherry picked from commit 5171df66eb54c9819b3b40045755f5e9b2cf36c2)

commit e154a5847aa07aa54a1ee83a8585ae38f3faa1b1
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 14:34:21 2008 +0100

    net_conf: use talloc_stackframe() instead of talloc_init().
    
    Michael
    (cherry picked from commit ab4fd03705c61114742d8438dece69b9c37c3b38)

commit 27be80c02c1c4f6340212a364ab867770c70377d
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 14:33:22 2008 +0100

    net_conf: fix import function by using the new text backend of smbconf.
    
    Originally, lp_load() was used to import files to registry.
    This had several bugs. Most notably, options explicitly set to
    default values were silently dropped, and all parametric options
    were ignored.
    
    This new implementation reads config from the text backend and
    stuffs everything verbatim in to the registry backend.
    
    Michael
    (cherry picked from commit e41c6650f805eaf8bb009e34468dd2d311e52858)

commit ad66f5df6a0c10bd0ed92a14643dbad31ff00c28
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 14:30:36 2008 +0100

    libsmbconf: add a text backend to libsmbconf based on the params.c parser.
    
    This is a simple implementation of text backend for libsmbconf.
    It is read only. It uses the parser from params.c. It loads the
    given config file and holds the parsed lists of strings in memory.
    Config is only re-read if the time stamp of the config file has changed.
    Brilliant performance on large files is not to be expected since the
    string lists are not hashed. This might be added in the future.
    
    Michael
    (cherry picked from commit 4ea50843852b335a9bd4c0535a5b684134ad8326)

commit a50cac83d03442e7894b68eb21a21df964930647
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 25 22:53:47 2008 +0100

    loadparm: add userdata parameter to do_section() and do_parameter().
    
    The userdata is currently unused. It can be used in the future for
    passing a context like in samba4 code.
    
    Michael
    (cherry picked from commit 31b31171bd88c41443268d3300c492e2347b9e73)

commit a0e8e74a11ca2ca3c63f52758ebb6cd4933196b0
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 10:55:26 2008 +0100

    smbconf: reformat - fix intentation.
    
    This time this won't make me stumble, since there is no
    magic in indented function headers here - no automatic
    prototype generation... :-)
    
    Michael
    (cherry picked from commit 6d72fc4373adff01cf6e0e18f78082d1eab90064)

commit 23d95324b506439835fb65cf18eb10fd2ddafd83
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 11:13:47 2008 +0100

    util_tdb: remove trivial and unused tdb_wipe().
    
    It has been replaced by tdb_wipe_all().
    
    Michael
    (cherry picked from commit cdde2e4eaca51d51f036ad99d55df7bfd6535b03)

commit dfbad488ae4e8ceb5b04c4d4687caf3de86c620b
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 10:50:08 2008 +0100

    use tdb_wipe_all() instead of tdb_wipe() - it is faster...
    
    Michael
    (cherry picked from commit 3d2fdcd50fdbfb66a14360516836445d47eceeb0)

commit 56e3660e4072d6bc6e69f0bcdc201dd28329327d
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 26 10:45:53 2008 +0100

    util_tdb: make the _byblob fetch/store functions public again.
    
    Users of these are currently being written...
    
    Michael
    (cherry picked from commit 1c51bec5318bad085c09931aa7e8f72f41d103fe)

commit 54f3133d52c0b5f1dff324f263a91a8a973de34f
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 25 15:55:03 2008 +0100

    util_tdb: add my (C) for the tdb validation code
    
    Michael
    (cherry picked from commit abf02a5a142c55d9e0053d319c867e4fcc3e6c30)

commit 26df11aca3fb448694dcd58cb0b74eae48f4e470
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 25 14:18:08 2008 +0100

    util_tdb: add a wrapper tdb_wipe() for traverse with tdb_traverse_delete_fn().
    
    Replace all callers of traverse with this tdb_traverse_delete_fn() and
    don't export tdb_traverse_delete_fn() anymore.
    
    Michael
    (cherry picked from commit d4be4e30cd8c3bdc303da30e42280f892a45a8c9)

commit 8381866d0789343c4dc88b84ba1e9c70ca69595b
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 25 13:53:31 2008 +0100

    util_tdb: add the tdb_pack_append() prototype to util_tdb.h
    
    This function is currently not used but seems useful.
    
    Michael
    (cherry picked from commit 48149a954c1e737c9863cfa0991ab9bfc246c6da)

commit 942fc35b0b445a517f43b2827c38107c1dd3757e
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 25 13:52:32 2008 +0100

    util_tdb: make the _byblob functions static - not currently used elsewhere.
    
    Michael
    (cherry picked from commit b42cf3fc69414270be9d0f430f2e95a72894f00e)

commit 153ec9d63c918f84b270b2d9fa8ecc03fd3658ba
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 25 13:41:51 2008 +0100

    util_tdb: group prototypes in util_tdb.h thematically
    
    Michael
    (cherry picked from commit 4b9231d33eaea2ada5d67cc1d959df2b671e7bb9)

commit ec8146433a4f262795628499838704f605b98110
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 25 12:54:14 2008 +0100

    build: don't autogenerate prototypes for util_tdb and dbwrap anymore.
    
    Stick to hand-written headers (that are there anyways).
    Add some missing prototypes to util_tdb.h and dbwrap.h.
    
    I did not bother to add a header for each single dbwrap backend
    open function but put the prototypes for the open functions into
    the central dbwrap.h.
    
    Michael
    (cherry picked from commit edf4dbed27a3c63c04e8110e75cdb76e31627eb6)

commit cb4dd308ec22148588da4e708527d40f62938949
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 22 02:05:53 2008 +0100

    registry: add reg_init_basic() - init registry with only the db backend.
    
    Michael
    (cherry picked from commit 1831042bdcbfe569ae39177058dfe1d914416513)

commit f1f74de5cc35380ddf6ab60d924bf47b5060758b
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 22 01:54:18 2008 +0100

    registry: close registry in exit path in registry_init_smbconf().
    
    Michael
    (cherry picked from commit 5aa3141bff35a85dd97e9fd339e19b0fe3a73afc)

commit 10acd27eff9ed5c2bc52cdd7615a66a5b500a836
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 22 01:53:44 2008 +0100

    registry: some whitespace cleanup in init_registry().
    
    Michael
    (cherry picked from commit f33095e44ba22f4451a5deeffdd4f9ed3f99ed85)

commit 55e4d8f08b52086e137e16d03612058be0503fff
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 22 01:52:03 2008 +0100

    registry: remove unneeded talloc stackframe variable.
    
    Michael
    (cherry picked from commit 81993db828bf11b13d7ee1f43483968dc6241bcc)

commit 8de8bb35eedc0a719e3d2043bf6e81f63ee0c641
Author: Michael Adam <obnox at samba.org>
Date:   Sat Mar 22 01:49:21 2008 +0100

    registry: close regdb in error path (and use it) in init_registry().
    
    Michael
    (cherry picked from commit 73b325fe7a9d7fd67ac9b99144a3776f5a1a9e15)

commit 57498e81d623977868c004648649ea134c9de4f0
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 23:50:49 2008 +0100

    registry: fix registry_init_smbconf() to close the registry at the end.
    
    Michael
    (cherry picked from commit f4d87fdbf266a36fbb50dae863ee0784165c2fe1)

commit 6ac9588360798520f0dc658923963315732f7654
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 23:39:01 2008 +0100

    libsmbconf: add internal open/close handling to registry backend.
    
    This internally keeps track of opened registry in the private data
    struct. The first call that really accesses data, opens the registry
    and it is kept open until the destructor is called.
    
    This behaviour might be changed in the future.
    
    Michael
    (cherry picked from commit 03e72e13076e3215eb8ae51cfb4e7cd3d3683d3e)

commit fc94697d399d6e86ae76d9f33ad30ecd79c15852
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 22:55:20 2008 +0100

    libsmbconf: add a comment.
    
    Michael
    (cherry picked from commit 513ae78ef78d3ddcb155f9c38b9a0c82809e0998)

commit 5623cbc2f5c91679123e266646ecf1d36ffc82ad
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 22:52:27 2008 +0100

    libsmbconf: add private_data section to smbconf_ctx.
    
    This private data should be used by backends.
    The token for the registry backend is moved from
    the context to the private data section, since
    this is registry specific.
    
    Michael
    (cherry picked from commit a02163356bdd0c17a25a45e9904f8bd1e1c4bee4)

commit 160f6b13bec74fc2a99bc68dc1b6a391ba03561a
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 17:55:31 2008 +0100

    libsmbconf: add a "path" variable to the conf context.
    
    This is passed to the module init routines.
    In case of the registry, this is the path of the
    basekey in registry, that is to be used, defaulting
    to KEY_SMBCONF (HKLM\software\samba\smbconf), when
    NULL is given. This is the only case currently used.
    
    In order to support other keys, registry initialization
    for smbconf has to be changed to support different keys.
    
    Michael
    (cherry picked from commit 96434d9dc7a66773e313cc128af57493dee245a1)

commit 35fcc34bdb5d6a82d9f20052712ea121f705f654
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 16:45:25 2008 +0100

    libsmbconf: add structuring comments to the prototypes in the public header.
    
    Michael
    (cherry picked from commit 4f816df27670c3b6aabea9f26ef2d26f3e882e78)

commit f1df31dad223c7c875152c67c286376c834dca12
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 16:42:42 2008 +0100

    libsmbconf: adapt a comment to new circumstances
    
    Michael
    (cherry picked from commit 83b9453c88bfdf615cc2b547645b0a71a870f473)

commit b6312361afea3629bccfca22b655c0dd4127816e
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 16:40:20 2008 +0100

    libsmbconf: group together functions in smbconf.c more appropriately
    
    Michael
    (cherry picked from commit e8ed8ad077f69ae7237f49b150625d20eb509586)

commit 5942995b27621bb6685415848976bd8db96c9cde
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 16:35:52 2008 +0100

    libsmbconf: add a comment.
    
    Michael
    (cherry picked from commit 8974b283683799bc51223d27b7e6aecac741fbc2)

commit dec6e3377577f6b9fced33c36273407d4465b73c
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 16:26:50 2008 +0100

    libsmbconf: move registry implementation to a module of its own.
    
    Michael
    (cherry picked from commit 431b10bfe0dba0a49e50bebfb3f8ad1a00955837)

commit 735f97fdfb68a5cafe11a2d288b8e2e8fca1c162
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 02:29:09 2008 +0100

    libsmbconf: reformaat - fix some whispacing/tabs
    
    Michael
    (cherry picked from commit 1a5e5bf38f409b10c8b1da6227722c7d3976b175)

commit a7e1479d380931d74975d2fe39222fca2cc8e123
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 02:20:16 2008 +0100

    libsmbconf: add backend specific init function.
    
    Hide generic init function taking smbconf_ops argument
    from public api.
    
    Michael
    (cherry picked from commit b3f6920ccb9a27fde26e889a7f1f3afaf56b784f)

commit 1c7d4e946122fcaef7db4de152e9a88d34eec925
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 02:01:55 2008 +0100

    libsmbconf: add shutdown handler to smbconf_ops.
    
    Michael
    (cherry picked from commit acbd1f40e0cb4cb5b2ba826c4825edda7ee4937b)

commit a7c3ab80513519e0aca9da6631d8141011434415
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 01:15:20 2008 +0100

    libsmbconf: fix comments
    
    Michael
    (cherry picked from commit 24f32d9bd9aa837d777ea4187bebf3146a67ce59)

commit ac3bfa12281658add7a5e998958382f9c105f313
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 21 01:04:57 2008 +0100

    libsmbconf: rename smbconf_close() to smbconf_shutdown().
    
    Michael
    (cherry picked from commit 797b26ad3fad27e085827efb61f6b4d8b37e93f0)

commit a340bfbe5b41aa2ebf2c81afbe52e87a0d91065f
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 23:41:39 2008 +0100

    libsmbconf: rename smbconf_open() to smbconf_init().
    
    That's more appropriate.
    
    Michael
    (cherry picked from commit d7bd9bb8aa2003ec0a9860df26857f67255febe2)

commit 8fbcccc4be4476a25307c1d288bf7755f0f71719
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 18:40:09 2008 +0100

    libsmbconf: add open and close operations to the smbconf_ops.
    
    Note: currently, reg_init_smbconf opens the registry, but does
    not close it. This has to be changed. so that it is closed.
    And then libsmbconf will need these open/close functions
    
    Michael
    (cherry picked from commit 77dbdf82efa60c8a7c00e489c198775b2f66e56c)

commit 6947da86635fd40f0be6402eb5e3670d87c07d8d
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 12:28:41 2008 +0100

    libsmbconf: introduce a smbconf_ops layer to allow interchangeable backends.
    
    Michael
    (cherry picked from commit a857f643d1558c0fdab4b647695d75223b730b96)

commit 5c409e3db49d1c7ccbd9bd759f585455efcdbaa2
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 12:25:44 2008 +0100

    libsmbconf: move smbconf_reg_initialize() down to the smbconf operations.
    
    Michael
    (cherry picked from commit f2d605006cd1187f70a044c3356d436e91093d5f)

commit 00ff462828c5ab96835bdaf5a98bff9a33a5dc03
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 11:54:30 2008 +0100

    libsmbconf: add existence check for service to smbconf_delete_share().
    
    Michael
    (cherry picked from commit d44c2ef0b7d7bddb4115b596872748132ebd6ddc)

commit 912717178b565c4ea9000f766e2ec0f3a799e1c1
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 11:53:40 2008 +0100

    libsmbconf: add existence check for service to smbconf_get_share().
    
    Michael
    (cherry picked from commit 26208d3e96a1e257628366709a1d71ac36f0788b)

commit 51bdee01edc096c48d1404f6c7e5ceeeea65d423
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 11:52:13 2008 +0100

    libsmbconf: add check for NULL servicename to smbconf_share_exists().
    
    Michael
    (cherry picked from commit 5dac66c82af8c87df723092a9309304846684418)

commit f67d05d2de65a63c0226e51324e269218c3d55a5
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 11:50:06 2008 +0100

    libsmbconf: fix a comment
    (cherry picked from commit 103a37ac8e85e9a7b8c2f4eb33e6f1cdbe01d31c)

commit 3dd9e3610b00c0bd4458168d88f611a511f580af
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 11:49:26 2008 +0100

    libsmbconf: refactor out registry implementation of smbconf operations.
    
    This leaves most of the api functions mere wrappers except for some
    common initial checks.
    
    Michael
    (cherry picked from commit 9448a7a298e9ed035aa6b86df18f2d41081731cc)

commit 17d2173dc3e539593e559a897983cbe9658f221b
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 10:43:17 2008 +0100

    libsmbconf: refactor autocreation of [global] into a helper function.
    
    Michael
    (cherry picked from commit aeaf66c064de58c6f19d5a9d226843dedb552011)

commit 8099df79b624e9a4e36352a25a73f1f08b2d9b0c
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 19 12:37:17 2008 +0100

    libsmbconf: put the smbconf context struct into a private header.
    
    Michael
    (cherry picked from commit a99ee5e536eee1563c90e5d7f251bfe9f5d1ffbb)

commit 5fd73bf80f7c1f23cd0dad56adcc4e90e4abe956
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 19 10:47:23 2008 +0100

    libsmbconf: change the API to always take the smbconf_ctx parameter first.
    
    ..for consistency. Exception: the open/init function, where the smbconf_ctx
    is created from the given talloc context.
    
    Michael
    (cherry picked from commit 304dba6cb2184437f3edad065a530d03fb704036)

commit 36763920456164c475a16da95184528e1454ef83
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 19 10:15:16 2008 +0100

    libsmbconf: fix indentation.
    
    Michael
    (cherry picked from commit 7460697ea42764f5f658a4f7f70872a56aeb160d)

commit 6bbedaf8f463d39351d1aca42333e3e99d023f13
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 18 23:29:11 2008 +0100

    libsmbconf: change smbconf_get_seqnum() to smbconf_changed().
    
    The former seqnum is hidden inside a struct smbconf_csn.
    And the get_seqnum is united with a changed function that
    stores the seqnum inside the given csn.
    
    Michael
    (cherry picked from commit 5b6b90900a1a3eab24cb5612d78f9678a363cf73)

commit 95b82e64142210c41247ec91669ba5fac6afd45e
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 18 00:51:15 2008 +0100

    libsmbconf: fix a comment
    
    Michael
    (cherry picked from commit e6b60f6cad32ce8bb78abb070889dde3eca2d268)

commit 9901c1675a206a0b842429d5e7321844d96bc2ce
Author: Derrell Lipman <derrell.lipman at unwireduniverse.com>
Date:   Thu Mar 6 10:41:42 2008 -0500

    Eliminate global variable in_client and a plethora of extern declarations.
    
    Derrell
    (cherry picked from commit b7f34e7ef2907b498a0645ce68f2773ed7d60cdc)

commit c5b654d146996102278a0f355e838ac827e0649f
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 19 15:18:06 2008 +0100

    loadparm: reenable checking files for updates while in registry configuration.
    
    This is necessary now that includes (to files) are enabled from registry.
    
    Michael
    (cherry picked from commit 7dc64d1021e0b8f3339f811c8c144f7013a649a8)

commit e4599a5297333d19af16da15e55b170cc6e53466
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 19 11:00:29 2008 +0100

    loadparm: remove unneeded include.
    
    libnet.h unneeded after separation of libsmbconf from libnet.
    
    Michael
    (cherry picked from commit 5c3f14e02fa7baf11d9a6531f2de3e6b16d843b0)

commit c1dd4a2caa4bf9d785401942ec83e9cd796e47df
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 14:35:41 2008 +0100

    registry: use available string constant in debug statement.
    
    Michael
    (cherry picked from commit 6bac03a2ec6351ab9db457d904b8925c828086e8)

commit 8fbaa074621836e8baee7daab764bc91f8589ec8
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 14:33:43 2008 +0100

    registry: in regdb_init, not only complain about INFO/version, store it...
    
    Michael
    (cherry picked from commit 27d67365ad03f0a0cd86011758a122a97513b82e)

commit 10107e3d5f92aeb70d66b5b311f8dc542e88b761
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 14:26:42 2008 +0100

    registry: reformat regdb_init() slightly, breaking long lines.
    
    Michael
    (cherry picked from commit 11da885f1e82e7a08fac2bc0ec1515694caa6340)

commit 2c608b8309c385d5c0f3017d6d709e4fbc72808a
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 14:24:12 2008 +0100

    registry: untangle assignment and if-statement in regdb_init().
    
    Michael
    (cherry picked from commit 504058df9706ee4e4c2e7fb1b1e41710bce2f87d)

commit 631d03f3aa4a77bb8372acf11c0a825498283e86
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 14:08:29 2008 +0100

    registry: separate initialization of registry data from regdb_init().
    
    Leave this to the users (currently registry_init_smbconf() and
    init_registry()) to initialize as much of preliminary registry data
    as needed.
    
    Michael
    (cherry picked from commit 59fdd30c789ccfd5cff356e459f1653b065b985c)

commit 3c038ec0bb36cc02f73f2fc64b77e56a4e9b4960
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 14:01:13 2008 +0100

    registry: add a transaction wrapper to init_registry_key_internal().
    
    Michael
    (cherry picked from commit 8b9cff84d5c39e6d7c315d87ac2fdf7fc0d4e4c4)

commit a76637f989c5671f286df2657c4f6ec4e4f0a2ca
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 20 13:59:09 2008 +0100

    registry: refactor creation of subkeys out of init_registry_data().
    
    Michael
    (cherry picked from commit 55233f875ebe1d515c65d9322cda69eb52d4c7d5)

commit 0382fb2e2585a8b92363f9378338b37d505413d1
Author: Michael Adam <obnox at samba.org>
Date:   Mon Mar 17 18:01:33 2008 +0100

    libsmbconf: rename all occurrences of libnet_conf_ to smbconf_ .
    
    Michael
    (cherry picked from commit 097af0309d7c3e9342058ba5266667293b23c80d)

commit c58deefeffa73b84a213baf7601cada498fb83c9
Author: Michael Adam <obnox at samba.org>
Date:   Mon Mar 17 17:29:44 2008 +0100

    Move libnet_conf to a library lib/smbconf/ of its own, fixing the api.
    
    The libnet_conf code to access the registry based configuration has
    become more of a library used in several places in samba (e.g. loadparm)
    than an abstraction of "net conf". So I move it to a location lib/smbconf/.
    
    In the same breath, the api is fixed (not generated by make proto anymore).
    
    Michael
    (cherry picked from commit 5315ef41f403b96715dd68b512e9e74662e2910a)

commit 659b33c498fa42176f000386168e6b34802689e6
Author: Michael Adam <obnox at samba.org>
Date:   Mon Mar 10 12:32:56 2008 +0100

    Reformat: Remove indentation of part of pam_smbpass/support.c by one tab.
    
    The first 120 lines of this source file were indented by one tab.
    Sorry, but I could not stand this..
    
    Michael
    (cherry picked from commit 728723dea39b2e978bfc4162ef99e883f3647a4b)

commit dbafde6502996fb7e4500ca0bf7f431abf51153a
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 6 09:25:38 2008 +0100

    Test: Properly track current test binary for tracking crashes.
    
    Make sure the panic action always has the right test binary set.
    
    Michael
    (cherry picked from commit 567ac329dcec6fc839d6b25cbf1872f1f51ff7e5)

commit 41e582e1157bc4a44f86a46d044acfa5081eb09f
Author: Michael Adam <obnox at samba.org>
Date:   Fri Feb 29 13:35:16 2008 +0100

    Eliminate tons of build warnings on non-IPV6 system.
    
    Michael
    (cherry picked from commit ee4810099c2d26a0ebab3c41a95bc6b57921683d)

commit 34cd00dcaaedb554fdf32a70c6aa6e0f0dad3d5e
Author: Michael Adam <obnox at samba.org>
Date:   Fri Feb 29 13:17:18 2008 +0100

    Revert "make idl: Only compile idl files newer than the output to be generated."
    
    This reverts commit 79c199d16e565eabd9fd971247f8df62689bb92a.
    
    Revert this until pidl is capable of doing decent dependency tracking
    itself (importing types from imported idls).
    
    Michael
    (cherry picked from commit 1fb69ad1f5c79dd77f73a5fee266e1e363e6974d)

commit b032f1cc445f02f0232e99627a23ee5d03bb7ce8
Author: Michael Adam <obnox at samba.org>
Date:   Fri Feb 29 13:15:56 2008 +0100

    Revert "Add libnet_join.idl to the IDL files to be processed by "make idl"."
    
    This reverts commit 9b47a7329091b2bfe7cd9b2112ac8fa652ed9f60.
    
    libnet_join.idl should not be processed along with the other idl files
    since it should not produce server and client code, just the header.
    
    Michael
    (cherry picked from commit 2967b29f23e04f24a62ea576b0b6c948055689d0)

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

Summary of changes:
 source/Makefile.in                      |   17 +-
 source/client/client.c                  |    3 +-
 source/client/smbspool.c                |    3 +-
 source/groupdb/mapping_tdb.c            |    2 +-
 source/include/dbwrap.h                 |   21 +
 source/include/includes.h               |    7 +
 source/include/util_tdb.h               |   55 ++-
 source/intl/lang_tdb.c                  |    2 +-
 source/lib/netapi/serverinfo.c          |   11 +-
 source/lib/sharesec.c                   |    2 +-
 source/lib/smbconf/smbconf.c            |  425 ++++++++++++++
 source/lib/smbconf/smbconf.h            |   89 +++
 source/lib/smbconf/smbconf_private.h    |   70 +++
 source/lib/smbconf/smbconf_reg.c        |  805 +++++++++++++++++++++++++
 source/lib/smbconf/smbconf_txt_simple.c |  542 +++++++++++++++++
 source/lib/util_sock.c                  |    2 +-
 source/lib/util_tdb.c                   |   14 +-
 source/libnet/libnet.h                  |    1 -
 source/libnet/libnet_conf.c             |  973 -------------------------------
 source/libnet/libnet_conf.h             |   27 -
 source/libnet/libnet_join.c             |   34 +-
 source/libsmb/libsmb_context.c          |    2 +-
 source/pam_smbpass/pam_smb_acct.c       |    3 +-
 source/pam_smbpass/pam_smb_auth.c       |    3 +-
 source/pam_smbpass/pam_smb_passwd.c     |    4 +-
 source/pam_smbpass/support.c            |  204 ++++----
 source/param/loadparm.c                 |   83 ++--
 source/param/params.c                   |   28 +-
 source/printing/printing.c              |    2 +-
 source/registry/reg_backend_db.c        |  236 +++++---
 source/registry/reg_init_basic.c        |   45 ++
 source/registry/reg_init_full.c         |   29 +-
 source/registry/reg_init_smbconf.c      |    6 +
 source/script/build_idl.sh              |    2 +-
 source/script/tests/selftest.sh         |   13 +-
 source/utils/net_conf.c                 |  369 ++++--------
 36 files changed, 2550 insertions(+), 1584 deletions(-)
 create mode 100644 source/lib/smbconf/smbconf.c
 create mode 100644 source/lib/smbconf/smbconf.h
 create mode 100644 source/lib/smbconf/smbconf_private.h
 create mode 100644 source/lib/smbconf/smbconf_reg.c
 create mode 100644 source/lib/smbconf/smbconf_txt_simple.c
 delete mode 100644 source/libnet/libnet_conf.c
 delete mode 100644 source/libnet/libnet_conf.h
 create mode 100644 source/registry/reg_init_basic.c


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index 2e86349..8aeab7a 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -324,7 +324,8 @@ LIB_WITHOUT_PROTO_OBJ = $(LIBSAMBAUTIL_OBJ) \
 	lib/messages.o librpc/gen_ndr/ndr_messaging.o lib/messages_local.o \
 	lib/messages_ctdbd.o lib/packet.o lib/ctdbd_conn.o lib/talloc_stack.o \
 	lib/interfaces.o lib/rbtree.o lib/memcache.o \
-	lib/util_transfer_file.o lib/async_req.o
+	lib/util_transfer_file.o lib/async_req.o \
+	$(TDB_OBJ)
 
 LIB_WITH_PROTO_OBJ = $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \
 	  lib/interface.o lib/md4.o \
@@ -342,7 +343,7 @@ LIB_WITH_PROTO_OBJ = $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \
 	  lib/tallocmsg.o lib/dmallocmsg.o libsmb/smb_signing.o \
 	  lib/md5.o lib/hmacmd5.o lib/arc4.o lib/iconv.o \
 	  lib/pam_errors.o intl/lang_tdb.o lib/conn_tdb.o \
-	  lib/adt_tree.o lib/gencache.o $(TDB_OBJ) \
+	  lib/adt_tree.o lib/gencache.o \
 	  lib/module.o lib/events.o lib/ldap_escape.o @CHARSET_STATIC@ \
 	  lib/secdesc.o lib/util_seaccess.o lib/secace.o lib/secacl.o \
 	  libads/krb5_errs.o lib/system_smbd.o lib/audit.o $(LIBNDR_OBJ) \
@@ -360,7 +361,7 @@ READLINE_OBJ = lib/readline.o
 POPT_LIB_OBJ = lib/popt_common.o
 
 PARAM_WITHOUT_REG_OBJ = dynconfig.o param/loadparm.o param/params.o param/util.o lib/sharesec.o lib/ldap_debug_handler.o
-PARAM_REG_ADD_OBJ = $(REG_SMBCONF_OBJ) $(LIBNET_CONF_OBJ) $(PRIVILEGES_BASIC_OBJ)
+PARAM_REG_ADD_OBJ = $(REG_SMBCONF_OBJ) $(LIBSMBCONF_OBJ) $(PRIVILEGES_BASIC_OBJ)
 PARAM_OBJ = $(PARAM_WITHOUT_REG_OBJ) $(PARAM_REG_ADD_OBJ)
 
 KRBCLIENT_OBJ = libads/kerberos.o libads/ads_status.o
@@ -662,6 +663,7 @@ SMBD_OBJ_BASE = $(PARAM_WITHOUT_REG_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \
 		$(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(LIBADS_SERVER_OBJ) \
 		$(REG_FULL_OBJ) $(POPT_LIB_OBJ) $(BUILDOPT_OBJ) \
 		$(SMBLDAP_OBJ) $(LDB_OBJ) $(LIBNET_OBJ) @LIBWBCLIENT_STATIC@ \
+		$(LIBSMBCONF_OBJ) \
 		$(PRIVILEGES_BASIC_OBJ)
 
 PRINTING_OBJ = printing/pcap.o printing/print_svid.o printing/print_aix.o \
@@ -808,6 +810,7 @@ LIBNETAPI_OBJ1 = lib/netapi/netapi.o \
 		 lib/netapi/getdc.o
 
 LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
+		 $(LIBSMBCONF_OBJ) \
 		 $(REG_SMBCONF_OBJ) \
 		 $(PARAM_WITHOUT_REG_OBJ) $(LIB_NONSMBD_OBJ) \
 		 $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
@@ -815,9 +818,10 @@ 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)
 
-LIBNET_CONF_OBJ = libnet/libnet_conf.o
+LIBSMBCONF_OBJ = lib/smbconf/smbconf.o lib/smbconf/smbconf_reg.o \
+		 lib/smbconf/smbconf_txt_simple.o
 
-LIBNET_OBJ = $(LIBNET_CONF_OBJ) libnet/libnet_join.o \
+LIBNET_OBJ = libnet/libnet_join.o \
 	     librpc/gen_ndr/ndr_libnet_join.o
 
 NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_help.o \
@@ -840,6 +844,7 @@ NET_OBJ = $(NET_OBJ1) $(PARAM_WITHOUT_REG_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
 	  $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(READLINE_OBJ) \
 	  $(LDB_OBJ) $(LIBGPO_OBJ) @BUILD_INIPARSER@ $(DISPLAY_SEC_OBJ) \
 	  $(REG_SMBCONF_OBJ) @LIBNETAPI_STATIC@ $(LIBNET_OBJ) \
+	  $(LIBSMBCONF_OBJ) \
 	  $(WBCOMMON_OBJ) @LIBWBCLIENT_STATIC@ \
 	  $(PRIVILEGES_BASIC_OBJ)
 
@@ -1144,7 +1149,7 @@ modules: SHOWFLAGS $(MODULES)
 IDL_FILES = lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
 	srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl \
 	epmapper.idl messaging.idl xattr.idl misc.idl samr.idl security.idl \
-	dssetup.idl krb5pac.idl ntsvcs.idl libnet_join.idl
+	dssetup.idl krb5pac.idl ntsvcs.idl
 
 idl:
 	@IDL_FILES="$(IDL_FILES)" CPP="$(CPP)" PERL="$(PERL)" \
diff --git a/source/client/client.c b/source/client/client.c
index 9cb05c5..cda5a6a 100644
--- a/source/client/client.c
+++ b/source/client/client.c
@@ -33,7 +33,6 @@ extern int do_smb_browse(void); /* mDNS browsing */
 extern bool AllowDebugChange;
 extern bool override_logfile;
 extern char tar_type;
-extern bool in_client;
 
 static int port = 0;
 static char *service;
@@ -4697,7 +4696,7 @@ static int do_message_op(void)
 	pc = poptGetContext("smbclient", argc, (const char **) argv, long_options, 0);
 	poptSetOtherOptionHelp(pc, "service <password>");
 
-	in_client = true;   /* Make sure that we tell lp_load we are */
+        lp_set_in_client(true); /* Make sure that we tell lp_load we are */
 
 	while ((opt = poptGetNextOpt(pc)) != -1) {
 
diff --git a/source/client/smbspool.c b/source/client/smbspool.c
index e7df22c..e827df4 100644
--- a/source/client/smbspool.c
+++ b/source/client/smbspool.c
@@ -35,7 +35,6 @@
  * Globals...
  */
 
-extern bool		in_client;	/* Boolean for client library */
 
 
 /*
@@ -228,7 +227,7 @@ static bool smb_encrypt;
 
   setup_logging("smbspool", True);
 
-  in_client = True;   /* Make sure that we tell lp_load we are */
+  lp_set_in_client(True);       /* Make sure that we tell lp_load we are */
 
   load_case_tables();
 
diff --git a/source/groupdb/mapping_tdb.c b/source/groupdb/mapping_tdb.c
index c9c8cdc..9f2b250 100644
--- a/source/groupdb/mapping_tdb.c
+++ b/source/groupdb/mapping_tdb.c
@@ -76,7 +76,7 @@ static bool init_group_mapping(void)
 		/* if its an unknown version we remove everthing in the db */
 
 		if (vers_id != DATABASE_VERSION_V2) {
-			tdb_traverse(tdb, tdb_traverse_delete_fn, NULL);
+			tdb_wipe_all(tdb);
 			tdb_store_int32(tdb, vstring, DATABASE_VERSION_V2);
 		}
 
diff --git a/source/include/dbwrap.h b/source/include/dbwrap.h
index 5c82475..095719a 100644
--- a/source/include/dbwrap.h
+++ b/source/include/dbwrap.h
@@ -54,6 +54,27 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
 			   int hash_size, int tdb_flags,
 			   int open_flags, mode_t mode);
 
+struct db_context *db_open_rbt(TALLOC_CTX *mem_ctx);
+
+struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
+			       const char *name,
+			       int hash_size, int tdb_flags,
+			       int open_flags, mode_t mode);
+
+#ifdef CLUSTER_SUPPORT
+struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
+				const char *name,
+				int hash_size, int tdb_flags,
+				int open_flags, mode_t mode);
+#endif
+
+struct db_context *db_open_file(TALLOC_CTX *mem_ctx,
+				struct messaging_context *msg_ctx,
+				const char *name,
+				int hash_size, int tdb_flags,
+				int open_flags, mode_t mode);
+
+
 NTSTATUS dbwrap_delete_bystring(struct db_context *db, const char *key);
 NTSTATUS dbwrap_store_bystring(struct db_context *db, const char *key,
 			       TDB_DATA data, int flags);
diff --git a/source/include/includes.h b/source/include/includes.h
index 269baa5..c56c3cf 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -726,6 +726,8 @@ typedef char fstring[FSTRING_LEN];
 #include "async_req.h"
 #include "async_smb.h"
 
+#include "lib/smbconf/smbconf.h"
+
 /* used in net.c */
 struct functable {
 	const char *funcname;
@@ -1289,4 +1291,9 @@ void exit_server_fault(void) NORETURN_ATTRIBUTE ;
 #include "libnscd.h"
 #endif
 
+#if defined(HAVE_IPV6)
+void in6_addr_to_sockaddr_storage(struct sockaddr_storage *ss,
+				  struct in6_addr ip);
+#endif
+
 #endif /* _INCLUDES_H */
diff --git a/source/include/util_tdb.h b/source/include/util_tdb.h
index a970806..fcc723c 100644
--- a/source/include/util_tdb.h
+++ b/source/include/util_tdb.h
@@ -22,6 +22,9 @@
 
 #include "tdb.h"
 
+#include "talloc.h" /* for tdb_wrap_open() */
+#include "nt_status.h" /* for map_nt_error_from_tdb() */
+
 /* single node of a list returned by tdb_search_keys */
 typedef struct keys_node 
 {
@@ -45,9 +48,15 @@ struct tdb_validation_status {
 
 typedef int (*tdb_validate_data_func)(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *state);
 
+TDB_DATA make_tdb_data(const uint8 *dptr, size_t dsize);
+TDB_DATA string_tdb_data(const char *string);
+TDB_DATA string_term_tdb_data(const char *string);
+
 TDB_LIST_NODE *tdb_search_keys(struct tdb_context*, const char*);
 void tdb_search_list_free(TDB_LIST_NODE*);
-int32 tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int32 *oldval, int32 change_val);
+
+int tdb_chainlock_with_timeout( TDB_CONTEXT *tdb, TDB_DATA key,
+				unsigned int timeout);
 int tdb_lock_bystring(struct tdb_context *tdb, const char *keyval);
 int tdb_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval,
 				   int timeout);
@@ -55,27 +64,45 @@ void tdb_unlock_bystring(struct tdb_context *tdb, const char *keyval);
 int tdb_read_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval,
 					unsigned int timeout);
 void tdb_read_unlock_bystring(TDB_CONTEXT *tdb, const char *keyval);
+
+int32 tdb_fetch_int32_byblob(TDB_CONTEXT *tdb, TDB_DATA key);
 int32 tdb_fetch_int32(struct tdb_context *tdb, const char *keystr);
+bool tdb_store_uint32_byblob(TDB_CONTEXT *tdb, TDB_DATA key, uint32 value);
 bool tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32 value);
+int tdb_store_int32_byblob(TDB_CONTEXT *tdb, TDB_DATA key, int32 v);
 int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32 v);
+bool tdb_fetch_uint32_byblob(TDB_CONTEXT *tdb, TDB_DATA key, uint32 *value);
 bool tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32 *value);
-int tdb_traverse_delete_fn(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf,
-                     void *state);
+int32 tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int32 *oldval, int32 change_val);
+bool tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr,
+			      uint32 *oldval, uint32 change_val);
+
 int tdb_store_bystring(struct tdb_context *tdb, const char *keystr, TDB_DATA data, int flags);
+int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr,
+			     TDB_DATA data, int flags);
 TDB_DATA tdb_fetch_bystring(struct tdb_context *tdb, const char *keystr);
 int tdb_delete_bystring(struct tdb_context *tdb, const char *keystr);
-struct tdb_context *tdb_open_log(const char *name, int hash_size,
-				 int tdb_flags, int open_flags, mode_t mode);
-int tdb_unpack(const uint8 *buf, int bufsize, const char *fmt, ...);
-size_t tdb_pack(uint8 *buf, int bufsize, const char *fmt, ...);
-TDB_DATA make_tdb_data(const uint8 *dptr, size_t dsize);
-TDB_DATA string_tdb_data(const char *string);
-TDB_DATA string_term_tdb_data(const char *string);
 int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf,
 		    int flag);
-bool tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr,
-			      uint32 *oldval, uint32 change_val);
-int tdb_chainlock_with_timeout( TDB_CONTEXT *tdb, TDB_DATA key,
-				unsigned int timeout);
+int tdb_trans_delete(struct tdb_context *tdb, TDB_DATA key);
+
+int tdb_unpack(const uint8 *buf, int bufsize, const char *fmt, ...);
+size_t tdb_pack(uint8 *buf, int bufsize, const char *fmt, ...);
+bool tdb_pack_append(TALLOC_CTX *mem_ctx, uint8 **buf, size_t *len,
+		     const char *fmt, ...);
+
+struct tdb_context *tdb_open_log(const char *name, int hash_size,
+				 int tdb_flags, int open_flags, mode_t mode);
+
+struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
+			       const char *name, int hash_size, int tdb_flags,
+			       int open_flags, mode_t mode);
+
+NTSTATUS map_nt_error_from_tdb(enum TDB_ERROR err);
+
+int tdb_validate(struct tdb_context *tdb, tdb_validate_data_func validate_fn);
+int tdb_validate_open(const char *tdb_path, tdb_validate_data_func validate_fn);
+int tdb_validate_and_backup(const char *tdb_path,
+			    tdb_validate_data_func validate_fn);
 
 #endif /* __TDBUTIL_H__ */
diff --git a/source/intl/lang_tdb.c b/source/intl/lang_tdb.c
index 6ad9ef8..499b9eb 100644
--- a/source/intl/lang_tdb.c
+++ b/source/intl/lang_tdb.c
@@ -45,7 +45,7 @@ static bool load_msg(const char *msg_file)
 	}
 
 	/* wipe the db */
-	tdb_traverse(tdb, tdb_traverse_delete_fn, NULL);
+	tdb_wipe_all(tdb);
 
 	msgid = NULL;
 	
diff --git a/source/lib/netapi/serverinfo.c b/source/lib/netapi/serverinfo.c
index 09f275b..e83cc35 100644
--- a/source/lib/netapi/serverinfo.c
+++ b/source/lib/netapi/serverinfo.c
@@ -169,7 +169,7 @@ static WERROR NetServerSetInfoLocal_1005(struct libnetapi_ctx *ctx,
 					 uint32_t *parm_error)
 {
 	WERROR werr;
-	struct libnet_conf_ctx *conf_ctx;
+	struct smbconf_ctx *conf_ctx;
 	struct srvsvc_NetSrvInfo1005 *info1005;
 
 	if (!buffer) {
@@ -191,17 +191,16 @@ static WERROR NetServerSetInfoLocal_1005(struct libnetapi_ctx *ctx,
 		return WERR_NOT_SUPPORTED;
 	}
 
-	werr = libnet_conf_open(ctx, &conf_ctx);
+	werr = smbconf_init_reg(ctx, &conf_ctx, NULL);
 	if (!W_ERROR_IS_OK(werr)) {
 		goto done;
 	}
 
-	werr = libnet_conf_set_global_parameter(conf_ctx,
-						"server string",
-						info1005->comment);
+	werr = smbconf_set_global_parameter(conf_ctx, "server string",
+					    info1005->comment);
 
  done:
-	libnet_conf_close(conf_ctx);
+	smbconf_shutdown(conf_ctx);
 	return werr;
 }
 
diff --git a/source/lib/sharesec.c b/source/lib/sharesec.c
index f6ff701..5a8984f 100644
--- a/source/lib/sharesec.c
+++ b/source/lib/sharesec.c
@@ -65,7 +65,7 @@ static bool share_info_db_init(void)
 	}
 
 	if (vers_id != SHARE_DATABASE_VERSION_V2) {
-		tdb_traverse(share_tdb, tdb_traverse_delete_fn, NULL);
+		tdb_wipe_all(share_tdb);
 		tdb_store_int32(share_tdb, vstring, SHARE_DATABASE_VERSION_V2);
 	}
 	tdb_unlock_bystring(share_tdb, vstring);
diff --git a/source/lib/smbconf/smbconf.c b/source/lib/smbconf/smbconf.c
new file mode 100644
index 0000000..4315dd9
--- /dev/null
+++ b/source/lib/smbconf/smbconf.c
@@ -0,0 +1,425 @@
+/*
+ *  Unix SMB/CIFS implementation.
+ *  libnet smbconf registry Support
+ *  Copyright (C) Michael Adam 2007-2008
+ *  Copyright (C) Guenther Deschner 2007
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "includes.h"
+#include "smbconf_private.h"
+
+/**********************************************************************
+ *
+ * internal helper functions
+ *
+ **********************************************************************/
+
+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)) {
+		return smbconf_create_share(ctx, GLOBAL_NAME);
+	}
+	return WERR_OK;
+}
+
+
+/**********************************************************************
+ *
+ * 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.
+ *
+ **********************************************************************/
+
+/**
+ * Close the configuration.
+ */
+void smbconf_shutdown(struct smbconf_ctx *ctx)
+{
+	TALLOC_FREE(ctx);
+}
+
+/**
+ * Detect changes in the configuration.
+ * The given csn struct is filled with the current csn.
+ * smbconf_changed() can also be used for initial retrieval
+ * of the csn.
+ */
+bool smbconf_changed(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
+		     const char *service, const char *param)
+{
+	struct smbconf_csn old_csn;
+
+	if (csn == NULL) {
+		return false;
+	}
+


-- 
Samba Shared Repository


More information about the samba-cvs mailing list