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

Michael Adam obnox at samba.org
Thu Mar 19 11:17:35 GMT 2009


The branch, v3-3-test has been updated
       via  db367c32756fcdf669a2ea7dad51d4daf40770e0 (commit)
       via  0045eb93bfb8285bcf8165b9cb2c39ade59a0782 (commit)
       via  e574048770d8e40490f949b6e0673f1f44b6e644 (commit)
       via  5ad50bd6c0f5e030105b225f15a4e8e1d5c18999 (commit)
       via  eced96cf26b08b1fd606381eeced5abec9fac3c4 (commit)
       via  4c0a996876115e2877c3903b7b9953b527175a16 (commit)
       via  5446e47968f1c0ff2f6390e00b5483b6163be78f (commit)
       via  22c71fc6f054ffbe73346a8c20cc48b141312d95 (commit)
       via  ce1051dd5498fb864e959c66b15a16d6d0cadd31 (commit)
       via  da272a52894314bd12f43fbb52a24c8b9cc024e8 (commit)
       via  0b99c03824886432a86dcdc161a219a5dbad7c58 (commit)
       via  049d5745cbf2bba954e9a06cc0f255506805ae0f (commit)
       via  453c7e1503f814034765ebc6aac06dd11f89b381 (commit)
       via  d316cab3cb5037909121494d57cc2173e4c66a23 (commit)
       via  76a460aecab6d5a03af9b8b5d97cba15d364cfde (commit)
       via  7679a4b9179dd32599d3799fa02f42e1acfce3ef (commit)
       via  1eaff4f96768912b31795c1c8b6a4741e2e746e1 (commit)
       via  ed8e84dbda344b19f1c6037a630e60885f722f13 (commit)
       via  5fc572e9e9ddc1c87ddd4622428e41d3503ccc4b (commit)
       via  a6c9cd899a52cf093f557ddac9a7fb42cbae35d0 (commit)
       via  3e8393af5fc40116305af6f155de9bad203e0a8d (commit)
       via  bcbe20b30017f22f1f01d9620f149fdeefe3a9e0 (commit)
       via  3a0f670d425a37e435fecf575730834017e30940 (commit)
       via  3f2255ad1c67bcea2d812eedbb4def8c35ff110a (commit)
       via  f1c0b65da5cf90740c2013e20991a87f5a16fc2c (commit)
       via  811b3fefab29c109c6c134339a438c7e4ffb13fe (commit)
       via  d119cd129c6acd2f0eb16fcf3281744d717cd291 (commit)
       via  b26f384649b4285748bf0fb78d826651882208e7 (commit)
       via  391027d79eeb897c539d35877f5b27ea90efb40b (commit)
       via  078d121b4d4d74237ea11c39754fb2ba0dc496a9 (commit)
       via  c861f55a35e315f3561bc9b5a4d4d2e1b782fa31 (commit)
       via  128f91d4c26dd4635a88c4bc8939061300cf81b7 (commit)
       via  6a9c73e5c58837c1a6e0abc03e90e616520cdd91 (commit)
       via  9ca48a86fb6cf5fa30b622162877859b0c335f7e (commit)
       via  abc457fe4c167bfcd7c8a4a654e13884b8e1ef90 (commit)
       via  026b72903c852e46012ac60d9d42b14c6860a159 (commit)
       via  e95bcaefc98f4ddc461d60d2f6f812ef24c2f234 (commit)
       via  8dd46903944c48e171837729cbe937f54d9554b7 (commit)
       via  8353d9b764ec90948fb8a5cb39689ea39acc7f9f (commit)
       via  0509eee47ac2da1042bd1bb0d98695abc8ee44a3 (commit)
       via  4ddeed513ce5e2bb839570212d046145da70768b (commit)
       via  caa654d31fc65e3a08327e430ba5332776a21f11 (commit)
       via  32524d865158080421867b36f9b64bdc98ff07c9 (commit)
       via  e5936d910cfc3590a3b015e627a5fa308861eaf4 (commit)
       via  68d4e25aad23b670e4ff735377de59ba396940cd (commit)
       via  a470af9a18b328548f241dca4f744d25c7cdc13e (commit)
       via  11ed4d41906084a604797e761ffd27caf5c67ac3 (commit)
       via  f8fa246bbae0db96e16e8f3e327577920c6ecec5 (commit)
       via  c4a1fc734b70efa932df4d4f8d9c66ea4f83ad0b (commit)
       via  36f2aa636d1eb5394469c09f76fe2fb676dfcac7 (commit)
       via  6facbbb4020369c18b4312115fab9b8d6eceaf80 (commit)
       via  d5750eca159e0bf1095b102545838d771f26a7f7 (commit)
       via  5887fa35156df68416b4da4a45ef0576d8b203c1 (commit)
       via  8589fa2cfe8fb549b013d2f15a598e43e28b64d7 (commit)
       via  dc0583613dfd8ce8f9209a8fb56e6c41a14efd0a (commit)
       via  9dfc6c9de92e58173e73d67a6dd56b4b4336909b (commit)
       via  a077a710b9d402ed7ac86ab98dc2a98776b8f9bc (commit)
       via  9685cbd3ab0304c0439f668d7b4963ab264729b2 (commit)
       via  defb4430114091474dfef0114ebb176bfb5026ea (commit)
       via  13521c9c1e0f93ea956c1d0b22f1979e7124c72e (commit)
       via  4a6c0a234ddfa545f137f8842a7e92224e72bcad (commit)
       via  8dd78e82ef694f35604f5328378f2422dcd561f5 (commit)
       via  e035a2d419cab20e8cd8efd532b8388d4cc364a6 (commit)
       via  85a90a26baaf916862b45ab2114edf9bf6f2e46d (commit)
       via  7deb120bf22dc5857af9051eeba7b8dabe4016e5 (commit)
       via  9cb280f7d721c71c5cecc2fd56cc75ce4b4a7e5b (commit)
       via  5d2255e13cf2e468887a61fb9a7e99d2ba665333 (commit)
      from  bf1474aee37976f0d7e3cece8f39b0046ee54209 (commit)

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


- Log -----------------------------------------------------------------
commit db367c32756fcdf669a2ea7dad51d4daf40770e0
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 26 02:59:07 2009 +0100

    s3:registry: tighten the subkey loop in reg_deletekey_recursive()
    
    and loop from the end to the beginning so that we don't need
    to rehash the subkeys...
    
    This gets "net conf drop" with 2000 shares down to 14 seconds
    on my box.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 0045eb93bfb8285bcf8165b9cb2c39ade59a0782
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 26 02:57:59 2009 +0100

    s3:registry: use delete_reg_subkey() in reg_deletekey()
    
    This further speeds up net conf drop.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit e574048770d8e40490f949b6e0673f1f44b6e644
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 26 02:56:50 2009 +0100

    s3:registry: implement delete_subkey in the smbconf backend
    
    delegating the call to the db backend
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 5ad50bd6c0f5e030105b225f15a4e8e1d5c18999
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 26 02:56:00 2009 +0100

    s3:registry: implement delete_subkey in the db backend
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit eced96cf26b08b1fd606381eeced5abec9fac3c4
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 26 02:54:50 2009 +0100

    s3:registry: add a delete_subkey method to the backend ops.
    
    This is to provide a more atomic means of deleting a subkey of a key.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 4c0a996876115e2877c3903b7b9953b527175a16
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 26 01:43:58 2009 +0100

    s3:registry: refactor deletion of various subkey lists out of regdb_store_keys()
    
    Micheal
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 5446e47968f1c0ff2f6390e00b5483b6163be78f
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 26 01:22:03 2009 +0100

    s3:registry: streamline and cleanup regdb_set_secdesc() somewhat.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 22c71fc6f054ffbe73346a8c20cc48b141312d95
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 26 01:16:07 2009 +0100

    s3:registry: refactor deletion of value/secdesc/subkey list tdb records out
    
    of regdb_store_values().
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit ce1051dd5498fb864e959c66b15a16d6d0cadd31
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 23:13:07 2009 +0100

    s3:registry: streamline reg_deletekey() somewhat.
    
    use W_ERROR_... macros and separate assignments from checks
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit da272a52894314bd12f43fbb52a24c8b9cc024e8
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 22:06:47 2009 +0100

    s3:registry: use create_reg_subkey() in reg_createkey().
    
    Instead of calling store_reg_keys()
    
    On my box, importing 2000 shares into an empty smbconf key
    now takes some 32 seconds.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 0b99c03824886432a86dcdc161a219a5dbad7c58
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 22:04:58 2009 +0100

    s3:registry: implement create_subkey for the smbconf backend
    
    by delegating to the db backend
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 049d5745cbf2bba954e9a06cc0f255506805ae0f
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 22:04:07 2009 +0100

    s3:registry: implement create_subkey for the db backend.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 453c7e1503f814034765ebc6aac06dd11f89b381
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 21:59:54 2009 +0100

    s3:registry: add a create_subkey method to the backend ops.
    
    This is to provide a more atomic means of adding a subkey of a key.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit d316cab3cb5037909121494d57cc2173e4c66a23
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 16:55:28 2009 +0100

    source/include/nt_status.h: add macro W_ERROR_NOT_OK_GOTO(x, y)
    
    a goto destination can be specified as a second parameter.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 76a460aecab6d5a03af9b8b5d97cba15d364cfde
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 16:53:05 2009 +0100

    s3: move definition of W_ERROR_NOT_OK_GOTO_DONE down to nt_status.h
    
    where all the other W_ERROR_xyz macros are found as well.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 7679a4b9179dd32599d3799fa02f42e1acfce3ef
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 14:49:30 2009 +0100

    s3:net rpc registry: use regsubkey_ctr_init() instead of using talloc directly.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 1eaff4f96768912b31795c1c8b6a4741e2e746e1
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 09:53:16 2009 +0100

    s3:registry: hash the list of subkeys in the regsubkey_ctr
    
    This removes many loops over all the arrays
    (from regsubkey_ctr_key_exists) and thus
    reduces "net conf drop" from 1m55 to 48seconds
    and "net conf import" from 1m55 to 58 seconds
    for 2000 shares on my box.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit ed8e84dbda344b19f1c6037a630e60885f722f13
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 00:33:24 2009 +0100

    s3:registry: remove definition of regsubkey_ctr from the surface.
    
    All access is now through accessor functions in reg_objects.c
    This allows for performance tuning under the hood in the next step.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 5fc572e9e9ddc1c87ddd4622428e41d3503ccc4b
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 25 00:32:21 2009 +0100

    s3:profiles: use regsubkey_ctr_init() instead of using talloc directly.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit a6c9cd899a52cf093f557ddac9a7fb42cbae35d0
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 23:28:48 2009 +0100

    s3:registry: use regsubkey_ctr_init() in reg_eventlog.c
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 3e8393af5fc40116305af6f155de9bad203e0a8d
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 23:23:04 2009 +0100

    s3:services_db: use regsubkey_ctr_init() instead of using talloc directly
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit bcbe20b30017f22f1f01d9620f149fdeefe3a9e0
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 23:19:35 2009 +0100

    s3:registry: use regsubkey_ctr_get_seqnum() in reg_backend_db.c
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 3a0f670d425a37e435fecf575730834017e30940
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 23:19:08 2009 +0100

    s3:registry: use regsubkey_ctr_set_seqnum() in reg_backend_db.c
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 3f2255ad1c67bcea2d812eedbb4def8c35ff110a
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 23:18:20 2009 +0100

    s3:registry: use regsubkey_ctr_init() in reg_backend_db.c
    
    instead of using talloc directly.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit f1c0b65da5cf90740c2013e20991a87f5a16fc2c
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 23:17:05 2009 +0100

    s3:registry: use regsubkey_ctr_init() in reg_api.c
    
    instead of using talloc on struct regsubkey_ctr.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 811b3fefab29c109c6c134339a438c7e4ffb13fe
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 23:15:55 2009 +0100

    s3:registry: add regsubkey_ctr_get_seqnum() to hide implementation
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit d119cd129c6acd2f0eb16fcf3281744d717cd291
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 23:10:35 2009 +0100

    s3:registry: add regsubkey_ctr_set_seqnum to hide implementation from caller.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit b26f384649b4285748bf0fb78d826651882208e7
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 22:43:47 2009 +0100

    s3:registry: add a regsubkey_ctr_init function for allocating a regsubkey_ctr
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 391027d79eeb897c539d35877f5b27ea90efb40b
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 22:41:40 2009 +0100

    s3:registry: fix a comment
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 078d121b4d4d74237ea11c39754fb2ba0dc496a9
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 22:16:40 2009 +0100

    s3:registry: don't directly access key->subkeys->subkeys[] in reg_backend_db.c
    
    Use the reg_objects accessor regsubkey_ctr_specific_key() instead.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit c861f55a35e315f3561bc9b5a4d4d2e1b782fa31
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 21:12:26 2009 +0100

    s3:registry: don't directly access key->subkeys->subkeys[] in reg_api.c
    
    Use the reg_objects accessor regsubkey_ctr_specific_key() instead.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 128f91d4c26dd4635a88c4bc8939061300cf81b7
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 17:42:50 2009 +0100

    s3:registry: don't directly access key->subkeys->num_subkeys in reg_backend_db.
    
    Use the reg_objects api instead.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 6a9c73e5c58837c1a6e0abc03e90e616520cdd91
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 17:30:23 2009 +0100

    s3:registry: don't directly access key->subkeys->num_subkeys in reg_api.c
    
    Use the reg_objects api instead.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 9ca48a86fb6cf5fa30b622162877859b0c335f7e
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 15:19:18 2009 +0100

    s3:registry: replace typedef "REGSUBKEY_CTR" by "struct regsubkey_ctr"
    
    This paves the way for hiding the typedef and the implementation from the
    surface.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit abc457fe4c167bfcd7c8a4a654e13884b8e1ef90
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 17:51:09 2009 +0100

    Revert "Fix a O(n^2) algorithm in regdb_fetch_keys()"
    
    This reverts commit a13f065bad0f4d21a67e68b743f17f45bf0a4691.
    
    This fix is reverted, because the speedup is going to move
    further down into reg_objects.c. The unsorted list of subkey names
    is going to be indexed: This O(n^2) search bites us in more places.
    This re-establishes the abstraction of reg_objects.c.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 026b72903c852e46012ac60d9d42b14c6860a159
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 4 21:46:32 2009 +0100

    s3:net conf: reduce memory usage of "net conf import".
    
    "net conf import" was wrapped in one big transaction.
    This lead to MAX_TALLOC_SIZE being exceeded at roughly
    1500 shares. This patch resolves that problem by
    limiting the top level transactions in "net conf import"
    to 100 shares.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit e95bcaefc98f4ddc461d60d2f6f812ef24c2f234
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 10:54:13 2009 +0100

    s3:net: wrap net conf import into one big transaction
    
    This speeds up "net conf import" of a file with 2000 shares
    from 11 minutest to 1m50s on my box.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 8dd46903944c48e171837729cbe937f54d9554b7
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 11:25:44 2009 +0100

    s3:libsmbconf: add transactions to the libsmbconf api
    
    This is useful for wrapping higher level aggregate operations
    in transactions. The text backend implementations just return
    WERR_OK, the registry backend implementatoins use the
    regdb_transaction_start|commit|cancel routines just added.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 8353d9b764ec90948fb8a5cb39689ea39acc7f9f
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 15:40:05 2009 +0100

    s3:registry: wrap deletekey_recursive in one big transaction.
    
    This speeds up "net conf drop" with 2000 shares on my box from
    4m40s to 1m50s, leaving virtually only cpu load.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 0509eee47ac2da1042bd1bb0d98695abc8ee44a3
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 24 11:23:52 2009 +0100

    s3:registry: provide transaction_start|commit|cancel fns for the registry tdb
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 4ddeed513ce5e2bb839570212d046145da70768b
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Feb 22 10:11:29 2009 +0100

    Wrap creating the sorted subkey cache in a transaction
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit caa654d31fc65e3a08327e430ba5332776a21f11
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Feb 22 01:11:51 2009 +0100

    Add a comment describing the sorted subkeys
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 32524d865158080421867b36f9b64bdc98ff07c9
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Feb 20 06:01:16 2009 +0100

    Add sorted subkey cache
    
    On my box this gets net conf list for 1000 records down to .1 seconds
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit e5936d910cfc3590a3b015e627a5fa308861eaf4
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Feb 22 00:47:54 2009 +0100

    Add db_tdb_parse
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 68d4e25aad23b670e4ff735377de59ba396940cd
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Feb 22 00:18:05 2009 +0100

    Add dbwrap->parse_record
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit a470af9a18b328548f241dca4f744d25c7cdc13e
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 4 22:05:17 2009 +0100

    s3:dbwrap_ctdb_marshall_add: don't leak the ctdb_rec_data to the outside
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 11ed4d41906084a604797e761ffd27caf5c67ac3
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 4 22:02:07 2009 +0100

    s3:smbconf: move smbconf_share_exists checks into backend
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit f8fa246bbae0db96e16e8f3e327577920c6ecec5
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 21 18:00:42 2009 +0100

    Speed up "net conf list"
    
    For 1000 shares this speeds up net conf list from .6 to .25 seconds on my box
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit c4a1fc734b70efa932df4d4f8d9c66ea4f83ad0b
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 21 17:01:58 2009 +0100

    Speed up "net conf list"
    
    With 1000 shares in the registry, this changed the time of "net conf list" from
    1.1 seconds to .6 seconds.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 36f2aa636d1eb5394469c09f76fe2fb676dfcac7
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Mar 2 14:56:01 2009 +0100

    Make use of gpfs_get_real_filename optional
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 6facbbb4020369c18b4312115fab9b8d6eceaf80
Author: Michael Adam <obnox at samba.org>
Date:   Fri Feb 27 15:28:52 2009 +0100

    s3: Fix a memleak in dbwrap_rbt.
    
    The SMB_MALLOC'ed rbt node data was not free'd on talloc free of
    the db context. This is a quick fix using talloc instead of malloc
    for allocation of the node data.
    
    Since malloc was originally used for performance reasons, one
    might want to reverse to malloc and create a talloc destructor
    that walks the tree and frees all the node data if this talloc
    approach proves to be too slow..
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit d5750eca159e0bf1095b102545838d771f26a7f7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 30 14:36:48 2009 +0100

    s3:smbconftort: don't use reserved words ('test:', 'failure:', 'success:')
    
    Temporary results printfs should not contain reserved subunit words.
    
    metze
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 5887fa35156df68416b4da4a45ef0576d8b203c1
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jan 21 18:25:47 2009 +0100

    s3:libsmbconf: include smbconf headers with lib/smbconf prefix
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 8589fa2cfe8fb549b013d2f15a598e43e28b64d7
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jan 21 17:14:56 2009 +0100

    s3:libsmbconf: use talloc_free instead of TALLOC_FREE in txt backend
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit dc0583613dfd8ce8f9209a8fb56e6c41a14efd0a
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jan 21 17:12:50 2009 +0100

    s3:libsmbconf: use talloc_free instead of TALLOC_FREE in smbconf_init
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 9dfc6c9de92e58173e73d67a6dd56b4b4336909b
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jan 21 17:11:46 2009 +0100

    s3:libsmbconf: use talloc_free instead of TALLOC_FREE in testsuite
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit a077a710b9d402ed7ac86ab98dc2a98776b8f9bc
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jan 21 17:11:02 2009 +0100

    s3:libsmbconf: use talloc_free instead of TALLOC_FREE in smbconf_util.c
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 9685cbd3ab0304c0439f668d7b4963ab264729b2
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jan 21 17:10:20 2009 +0100

    s3:libsmbconf: use talloc_free instead of TALLOC_FREE in smbconf.c
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit defb4430114091474dfef0114ebb176bfb5026ea
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jan 21 16:59:09 2009 +0100

    s3:libsmbconf: remove the init headers from smbconf.h
    
    give the smbconf_init() dispatcher and the backends
    (smbconf_reg and smbconf_txt) a header of their own each.
    
    This allows to use the basic infrastructure and
    single backends individually.
    
    Michael
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 13521c9c1e0f93ea956c1d0b22f1979e7124c72e
Author: Michael Adam <obnox at samba.org>
Date:   Fri Oct 24 00:00:20 2008 +0200

    libsmbconf: create text config in smbconftort
    
    Michael

commit 4a6c0a234ddfa545f137f8842a7e92224e72bcad
Author: Michael Adam <obnox at samba.org>
Date:   Thu Oct 23 16:05:19 2008 +0200

    libsmbconf: return WERR_BADFILE when no path to text backend is provided.
    
    Michael

commit 8dd78e82ef694f35604f5328378f2422dcd561f5
Author: Michael Adam <obnox at samba.org>
Date:   Tue Oct 21 23:20:57 2008 +0200

    libsmbconf: fall back to file backend when no valid backend was found
    
    Interpret the source string as a file name when it contains
    a ':' sign but the initial part is not a known backend.
    This might occur even implicitly when "%T" is used in an
    include file name (even though this is not realistic..).
    
    Michael

commit e035a2d419cab20e8cd8efd532b8388d4cc364a6
Author: Michael Adam <obnox at samba.org>
Date:   Tue Oct 21 23:20:31 2008 +0200

    libsmbconf: fix comment typo.
    
    Michael

commit 85a90a26baaf916862b45ab2114edf9bf6f2e46d
Author: Michael Adam <obnox at samba.org>
Date:   Mon Oct 20 16:10:54 2008 +0200

    libsmbconf: remove unused define.
    
    Michael

commit 7deb120bf22dc5857af9051eeba7b8dabe4016e5
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jan 21 17:16:37 2009 +0100

    s3:libsmbconf: use talloc_free instead of TALLOC_FREE in reg backend
    
    Michael

commit 9cb280f7d721c71c5cecc2fd56cc75ce4b4a7e5b
Author: Michael Adam <obnox at samba.org>
Date:   Thu Oct 23 11:16:50 2008 +0200

    libsmbconf: add method is_writeable() and wrapper smbconf_is_writeable()
    
    This allows for per-config-source checking of write support.
    
    Michael

commit 5d2255e13cf2e468887a61fb9a7e99d2ba665333
Author: Michael Adam <obnox at samba.org>
Date:   Mon Oct 20 23:52:02 2008 +0200

    libsmbconf: add backend_requires_messaging() method to libsmbconf.
    
    In a clustered environment, the registry backend needs messaging
    to be set up since ctdb requires this.
    
    Michael

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

Summary of changes:
 source/include/dbwrap.h                       |    4 +
 source/include/includes.h                     |    3 +
 source/include/nt_status.h                    |   12 +
 source/include/proto.h                        |   30 +-
 source/include/reg_db.h                       |    1 +
 source/include/reg_objects.h                  |   16 +-
 source/include/regfio.h                       |    2 +-
 source/lib/dbwrap.c                           |   26 +
 source/lib/dbwrap_ctdb.c                      |   12 +-
 source/lib/dbwrap_rbt.c                       |    8 +-
 source/lib/dbwrap_tdb.c                       |   12 +
 source/lib/smbconf/smbconf.c                  |   64 ++--
 source/lib/smbconf/smbconf.h                  |   25 +-
 source/lib/smbconf/smbconf_init.c             |   20 +-
 source/lib/smbconf/smbconf_init.h             |   32 ++
 source/lib/smbconf/smbconf_private.h          |    5 +
 source/lib/smbconf/smbconf_reg.c              |  235 ++++-----
 source/lib/smbconf/smbconf_reg.h              |   33 ++
 source/lib/smbconf/smbconf_txt.c              |   43 ++-
 source/lib/smbconf/smbconf_txt.h              |   33 ++
 source/lib/smbconf/smbconf_util.c             |    4 +-
 source/lib/smbconf/testsuite.c                |   97 +++--
 source/libnet/libnet_join.c                   |    6 -
 source/modules/gpfs.c                         |    6 +-
 source/modules/vfs_gpfs.c                     |    5 +
 source/registry/reg_api.c                     |  183 ++++----
 source/registry/reg_backend_current_version.c |    2 +-
 source/registry/reg_backend_db.c              |  651 +++++++++++++++++++------
 source/registry/reg_backend_hkpt_params.c     |    2 +-
 source/registry/reg_backend_netlogon_params.c |    2 +-
 source/registry/reg_backend_perflib.c         |    2 +-
 source/registry/reg_backend_printing.c        |   20 +-
 source/registry/reg_backend_prod_options.c    |    2 +-
 source/registry/reg_backend_shares.c          |    4 +-
 source/registry/reg_backend_smbconf.c         |   16 +-
 source/registry/reg_backend_tcpip_params.c    |    2 +-
 source/registry/reg_dispatcher.c              |   24 +-
 source/registry/reg_eventlog.c                |   18 +-
 source/registry/reg_objects.c                 |  175 ++++++-
 source/registry/regfio.c                      |    2 +-
 source/services/services_db.c                 |   12 +-
 source/utils/net_conf.c                       |   58 ++-
 source/utils/net_rpc_registry.c               |   11 +-
 source/utils/profiles.c                       |    8 +-
 44 files changed, 1361 insertions(+), 567 deletions(-)
 create mode 100644 source/lib/smbconf/smbconf_init.h
 create mode 100644 source/lib/smbconf/smbconf_reg.h
 create mode 100644 source/lib/smbconf/smbconf_txt.h


Changeset truncated at 500 lines:

diff --git a/source/include/dbwrap.h b/source/include/dbwrap.h
index 46833fa..3381d2d 100644
--- a/source/include/dbwrap.h
+++ b/source/include/dbwrap.h
@@ -45,6 +45,10 @@ struct db_context {
 	int (*transaction_start)(struct db_context *db);
 	int (*transaction_commit)(struct db_context *db);
 	int (*transaction_cancel)(struct db_context *db);
+	int (*parse_record)(struct db_context *db, TDB_DATA key,
+			    int (*parser)(TDB_DATA key, TDB_DATA data,
+					  void *private_data),
+			    void *private_data);
 	void *private_data;
 	bool persistent;
 };
diff --git a/source/include/includes.h b/source/include/includes.h
index 7b24b72..baf22e8 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -730,6 +730,9 @@ typedef char fstring[FSTRING_LEN];
 #include "async_sock.h"
 
 #include "lib/smbconf/smbconf.h"
+#include "lib/smbconf/smbconf_init.h"
+#include "lib/smbconf/smbconf_reg.h"
+#include "lib/smbconf/smbconf_txt.h"
 
 /* Defines for wisXXX functions. */
 #define UNI_UPPER    0x1
diff --git a/source/include/nt_status.h b/source/include/nt_status.h
index 30174e4..c96ed3c 100644
--- a/source/include/nt_status.h
+++ b/source/include/nt_status.h
@@ -83,6 +83,18 @@ typedef uint32 WERROR;
 	}\
 } while (0)
 
+#define W_ERROR_NOT_OK_GOTO_DONE(x) do { \
+	if (!W_ERROR_IS_OK(x)) {\
+		goto done;\
+	}\
+} while (0)
+
+#define W_ERROR_NOT_OK_GOTO(x, y) do {\
+	if (!W_ERROR_IS_OK(x)) {\
+		goto y;\
+	}\
+} while(0)
+
 /* The top byte in an NTSTATUS code is used as a type field.
  * Windows only uses value 0xC0 as an indicator for an NT error
  * and 0x00 for success.
diff --git a/source/include/proto.h b/source/include/proto.h
index 51405f0..c2b318e 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -6721,12 +6721,15 @@ WERROR init_registry_data(void);
 WERROR regdb_init(void);
 WERROR regdb_open( void );
 int regdb_close( void );
+WERROR regdb_transaction_start(void);
+WERROR regdb_transaction_commit(void);
+WERROR regdb_transaction_cancel(void);
 int regdb_get_seqnum(void);
-bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr);
-int regdb_fetch_keys(const char *key, REGSUBKEY_CTR *ctr);
+bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr);
+int regdb_fetch_keys(const char *key, struct regsubkey_ctr *ctr);
 int regdb_fetch_values( const char* key, REGVAL_CTR *values );
 bool regdb_store_values( const char *key, REGVAL_CTR *values );
-bool regdb_subkeys_need_update(REGSUBKEY_CTR *subkeys);
+bool regdb_subkeys_need_update(struct regsubkey_ctr *subkeys);
 bool regdb_values_need_update(REGVAL_CTR *values);
 
 /* The following definitions come from registry/reg_backend_hkpt_params.c  */
@@ -6762,9 +6765,11 @@ void reghook_dump_cache( int debuglevel );
 
 /* The following definitions come from registry/reg_dispatcher.c  */
 
-bool store_reg_keys( REGISTRY_KEY *key, REGSUBKEY_CTR *subkeys );
+bool store_reg_keys( REGISTRY_KEY *key, struct regsubkey_ctr *subkeys );
 bool store_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val );
-int fetch_reg_keys( REGISTRY_KEY *key, REGSUBKEY_CTR *subkey_ctr );
+WERROR create_reg_subkey(REGISTRY_KEY *key, const char *subkey);
+WERROR delete_reg_subkey(REGISTRY_KEY *key, const char *subkey);
+int fetch_reg_keys( REGISTRY_KEY *key, struct regsubkey_ctr *subkey_ctr );
 int fetch_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val );
 bool regkey_access_check( REGISTRY_KEY *key, uint32 requested, uint32 *granted,
 			  const struct nt_user_token *token );
@@ -6772,7 +6777,7 @@ WERROR regkey_get_secdesc(TALLOC_CTX *mem_ctx, REGISTRY_KEY *key,
 			  struct security_descriptor **psecdesc);
 WERROR regkey_set_secdesc(REGISTRY_KEY *key,
 			  struct security_descriptor *psecdesc);
-bool reg_subkeys_need_update(REGISTRY_KEY *key, REGSUBKEY_CTR *subkeys);
+bool reg_subkeys_need_update(REGISTRY_KEY *key, struct regsubkey_ctr *subkeys);
 bool reg_values_need_update(REGISTRY_KEY *key, REGVAL_CTR *values);
 
 /* The following definitions come from registry/reg_eventlog.c  */
@@ -6798,11 +6803,14 @@ WERROR registry_init_smbconf(const char *keyname);
 
 /* The following definitions come from registry/reg_objects.c  */
 
-WERROR regsubkey_ctr_addkey( REGSUBKEY_CTR *ctr, const char *keyname );
-int regsubkey_ctr_delkey( REGSUBKEY_CTR *ctr, const char *keyname );
-bool regsubkey_ctr_key_exists( REGSUBKEY_CTR *ctr, const char *keyname );
-int regsubkey_ctr_numkeys( REGSUBKEY_CTR *ctr );
-char* regsubkey_ctr_specific_key( REGSUBKEY_CTR *ctr, uint32 key_index );
+WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr);
+WERROR regsubkey_ctr_set_seqnum(struct regsubkey_ctr *ctr, int seqnum);
+int regsubkey_ctr_get_seqnum(struct regsubkey_ctr *ctr);
+WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname );
+WERROR regsubkey_ctr_delkey( struct regsubkey_ctr *ctr, const char *keyname );
+bool regsubkey_ctr_key_exists( struct regsubkey_ctr *ctr, const char *keyname );
+int regsubkey_ctr_numkeys( struct regsubkey_ctr *ctr );
+char* regsubkey_ctr_specific_key( struct regsubkey_ctr *ctr, uint32 key_index );
 int regval_ctr_numvals( REGVAL_CTR *ctr );
 REGISTRY_VALUE* dup_registry_value( REGISTRY_VALUE *val );
 void free_registry_value( REGISTRY_VALUE *val );
diff --git a/source/include/reg_db.h b/source/include/reg_db.h
index 92448ae..5cafa0a 100644
--- a/source/include/reg_db.h
+++ b/source/include/reg_db.h
@@ -26,5 +26,6 @@
 
 #define REG_VALUE_PREFIX    "SAMBA_REGVAL"
 #define REG_SECDESC_PREFIX  "SAMBA_SECDESC"
+#define REG_SORTED_SUBKEYS_PREFIX  "SAMBA_SORTED_SUBKEYS"
 
 #endif /* _REG_DB_H */
diff --git a/source/include/reg_objects.h b/source/include/reg_objects.h
index d9159dd..a03ac1b 100644
--- a/source/include/reg_objects.h
+++ b/source/include/reg_objects.h
@@ -66,11 +66,7 @@ typedef struct {
 
 /* container for registry subkey names */
 
-typedef struct {
-	uint32          num_subkeys;
-	char            **subkeys;
-	int seqnum;
-} REGSUBKEY_CTR;
+struct regsubkey_ctr;
 
 /*
  *
@@ -132,9 +128,11 @@ typedef struct {
  
 typedef struct {
 	/* functions for enumerating subkeys and values */	
-	int 	(*fetch_subkeys)( const char *key, REGSUBKEY_CTR *subkeys);
+	int 	(*fetch_subkeys)( const char *key, struct regsubkey_ctr *subkeys);
 	int 	(*fetch_values) ( const char *key, REGVAL_CTR *val );
-	bool 	(*store_subkeys)( const char *key, REGSUBKEY_CTR *subkeys );
+	bool 	(*store_subkeys)( const char *key, struct regsubkey_ctr *subkeys );
+	WERROR	(*create_subkey)(const char *key, const char *subkey);
+	WERROR	(*delete_subkey)(const char *key, const char *subkey);
 	bool 	(*store_values)( const char *key, REGVAL_CTR *val );
 	bool	(*reg_access_check)( const char *keyname, uint32 requested,
 				     uint32 *granted,
@@ -143,7 +141,7 @@ typedef struct {
 			      struct security_descriptor **psecdesc);
 	WERROR (*set_secdesc)(const char *key,
 			      struct security_descriptor *sec_desc);
-	bool	(*subkeys_need_update)(REGSUBKEY_CTR *subkeys);
+	bool	(*subkeys_need_update)(struct regsubkey_ctr *subkeys);
 	bool	(*values_need_update)(REGVAL_CTR *values);
 } REGISTRY_OPS;
 
@@ -164,7 +162,7 @@ typedef struct _RegistryKey {
 
 struct registry_key {
 	REGISTRY_KEY *key;
-	REGSUBKEY_CTR *subkeys;
+	struct regsubkey_ctr *subkeys;
 	REGVAL_CTR *values;
 	struct nt_user_token *token;
 };
diff --git a/source/include/regfio.h b/source/include/regfio.h
index 63516a3..0e957d5 100644
--- a/source/include/regfio.h
+++ b/source/include/regfio.h
@@ -214,7 +214,7 @@ int           regfio_close( REGF_FILE *r );
 REGF_NK_REC*  regfio_rootkey( REGF_FILE *file );
 REGF_NK_REC*  regfio_fetch_subkey( REGF_FILE *file, REGF_NK_REC *nk );
 REGF_NK_REC*  regfio_write_key ( REGF_FILE *file, const char *name,
-                                 REGVAL_CTR *values, REGSUBKEY_CTR *subkeys,
+                                 REGVAL_CTR *values, struct regsubkey_ctr *subkeys,
                                  SEC_DESC *sec_desc, REGF_NK_REC *parent );
 
 
diff --git a/source/lib/dbwrap.c b/source/lib/dbwrap.c
index 73c2761..055f554 100644
--- a/source/lib/dbwrap.c
+++ b/source/lib/dbwrap.c
@@ -42,6 +42,29 @@ static int dbwrap_fallback_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
 	return 0;
 }
 
+/*
+ * Fall back using fetch if no genuine parse operation is provided
+ */
+
+static int dbwrap_fallback_parse_record(struct db_context *db, TDB_DATA key,
+					int (*parser)(TDB_DATA key,
+						      TDB_DATA data,
+						      void *private_data),
+					void *private_data)
+{
+	TDB_DATA data;
+	int res;
+
+	res = db->fetch(db, talloc_tos(), key, &data);
+	if (res != 0) {
+		return res;
+	}
+
+	res = parser(key, data, private_data);
+	TALLOC_FREE(data.dptr);
+	return res;
+}
+
 /**
  * open a database
  */
@@ -101,6 +124,9 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
 	if ((result != NULL) && (result->fetch == NULL)) {
 		result->fetch = dbwrap_fallback_fetch;
 	}
+	if ((result != NULL) && (result->parse_record == NULL)) {
+		result->parse_record = dbwrap_fallback_parse_record;
+	}
 
 	return result;
 }
diff --git a/source/lib/dbwrap_ctdb.c b/source/lib/dbwrap_ctdb.c
index 2818634..d5d4ac7 100644
--- a/source/lib/dbwrap_ctdb.c
+++ b/source/lib/dbwrap_ctdb.c
@@ -121,9 +121,9 @@ static struct ctdb_marshall_buffer *db_ctdb_marshall_add(TALLOC_CTX *mem_ctx,
 {
 	struct ctdb_rec_data *r;
 	size_t m_size, r_size;
-	struct ctdb_marshall_buffer *m2;
+	struct ctdb_marshall_buffer *m2 = NULL;
 
-	r = db_ctdb_marshall_record(mem_ctx, reqid, key, header, data);
+	r = db_ctdb_marshall_record(talloc_tos(), reqid, key, header, data);
 	if (r == NULL) {
 		talloc_free(m);
 		return NULL;
@@ -133,7 +133,7 @@ static struct ctdb_marshall_buffer *db_ctdb_marshall_add(TALLOC_CTX *mem_ctx,
 		m = (struct ctdb_marshall_buffer *)talloc_zero_size(
 			mem_ctx, offsetof(struct ctdb_marshall_buffer, data));
 		if (m == NULL) {
-			return NULL;
+			goto done;
 		}
 		m->db_id = db_id;
 	}
@@ -145,15 +145,15 @@ static struct ctdb_marshall_buffer *db_ctdb_marshall_add(TALLOC_CTX *mem_ctx,
 		mem_ctx, m,  m_size + r_size);
 	if (m2 == NULL) {
 		talloc_free(m);
-		return NULL;
+		goto done;
 	}
 
 	memcpy(m_size + (uint8_t *)m2, r, r_size);
 
-	talloc_free(r);
-
 	m2->count++;
 
+done:
+	talloc_free(r);
 	return m2;
 }
 
diff --git a/source/lib/dbwrap_rbt.c b/source/lib/dbwrap_rbt.c
index b70ce3d..7747be7 100644
--- a/source/lib/dbwrap_rbt.c
+++ b/source/lib/dbwrap_rbt.c
@@ -131,12 +131,12 @@ static NTSTATUS db_rbt_store(struct db_record *rec, TDB_DATA data, int flag)
 		 */
 	}
 
-	node = (struct db_rbt_node *)SMB_MALLOC(
+	node = (struct db_rbt_node *)talloc_size(rec_priv->db_ctx,
 		offsetof(struct db_rbt_node, data) + rec->key.dsize
 		+ data.dsize);
 
 	if (node == NULL) {
-		SAFE_FREE(rec_priv->node);
+		TALLOC_FREE(rec_priv->node);
 		return NT_STATUS_NO_MEMORY;
 	}
 
@@ -148,7 +148,7 @@ static NTSTATUS db_rbt_store(struct db_record *rec, TDB_DATA data, int flag)
 	db_rbt_parse_node(node, &this_key, &this_val);
 
 	memcpy(this_key.dptr, rec->key.dptr, node->keysize);
-	SAFE_FREE(rec_priv->node);
+	TALLOC_FREE(rec_priv->node);
 
 	memcpy(this_val.dptr, data.dptr, node->valuesize);
 
@@ -194,7 +194,7 @@ static NTSTATUS db_rbt_delete(struct db_record *rec)
 	}
 
 	rb_erase(&rec_priv->node->rb_node, &rec_priv->db_ctx->tree);
-	SAFE_FREE(rec_priv->node);
+	TALLOC_FREE(rec_priv->node);
 
 	return NT_STATUS_OK;
 }
diff --git a/source/lib/dbwrap_tdb.c b/source/lib/dbwrap_tdb.c
index 7bdadd3..5b6c819 100644
--- a/source/lib/dbwrap_tdb.c
+++ b/source/lib/dbwrap_tdb.c
@@ -176,6 +176,17 @@ static int db_tdb_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
 	return 0;
 }
 
+static int db_tdb_parse(struct db_context *db, TDB_DATA key,
+			int (*parser)(TDB_DATA key, TDB_DATA data,
+				      void *private_data),
+			void *private_data)
+{
+	struct db_tdb_ctx *ctx = talloc_get_type_abort(
+		db->private_data, struct db_tdb_ctx);
+
+	return tdb_parse_record(ctx->wtdb->tdb, key, parser, private_data);
+}
+
 static NTSTATUS db_tdb_store(struct db_record *rec, TDB_DATA data, int flag)
 {
 	struct db_tdb_ctx *ctx = talloc_get_type_abort(rec->private_data,
@@ -343,6 +354,7 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
 	result->fetch = db_tdb_fetch;
 	result->traverse = db_tdb_traverse;
 	result->traverse_read = db_tdb_traverse_read;
+	result->parse_record = db_tdb_parse;
 	result->get_seqnum = db_tdb_get_seqnum;
 	result->persistent = ((tdb_flags & TDB_CLEAR_IF_FIRST) == 0);
 	result->transaction_start = db_tdb_transaction_start;
diff --git a/source/lib/smbconf/smbconf.c b/source/lib/smbconf/smbconf.c
index 1a9b4e0..01557a7 100644
--- a/source/lib/smbconf/smbconf.c
+++ b/source/lib/smbconf/smbconf.c
@@ -43,11 +43,28 @@ static WERROR smbconf_global_check(struct smbconf_ctx *ctx)
  **********************************************************************/
 
 /**
+ * Tell whether the backend requires messaging to be set up
+ * for the backend to work correctly.
+ */
+bool smbconf_backend_requires_messaging(struct smbconf_ctx *ctx)
+{
+	return ctx->ops->requires_messaging(ctx);
+}
+
+/**
+ * Tell whether the source is writeable.
+ */
+bool smbconf_is_writeable(struct smbconf_ctx *ctx)
+{
+	return ctx->ops->is_writeable(ctx);
+}
+
+/**
  * Close the configuration.
  */
 void smbconf_shutdown(struct smbconf_ctx *ctx)
 {
-	TALLOC_FREE(ctx);
+	talloc_free(ctx);
 }
 
 /**
@@ -140,7 +157,7 @@ WERROR smbconf_get_config(struct smbconf_ctx *ctx,
 	}
 
 done:
-	TALLOC_FREE(tmp_ctx);
+	talloc_free(tmp_ctx);
 	return werr;
 }
 
@@ -186,10 +203,6 @@ WERROR smbconf_get_share(struct smbconf_ctx *ctx,
 			 const char *servicename,
 			 struct smbconf_service **service)
 {
-	if (!smbconf_share_exists(ctx, servicename)) {
-		return WERR_NO_SUCH_SERVICE;
-	}
-
 	return ctx->ops->get_share(ctx, mem_ctx, servicename, service);
 }
 
@@ -213,10 +226,6 @@ WERROR smbconf_set_parameter(struct smbconf_ctx *ctx,
 			     const char *param,
 			     const char *valstr)
 {
-	if (!smbconf_share_exists(ctx, service)) {
-		return WERR_NO_SUCH_SERVICE;
-	}
-
 	return ctx->ops->set_parameter(ctx, service, param, valstr);
 }
 
@@ -252,10 +261,6 @@ WERROR smbconf_get_parameter(struct smbconf_ctx *ctx,
 		return WERR_INVALID_PARAM;
 	}
 
-	if (!smbconf_share_exists(ctx, service)) {
-		return WERR_NO_SUCH_SERVICE;
-	}
-
 	return ctx->ops->get_parameter(ctx, mem_ctx, service, param, valstr);
 }
 
@@ -286,10 +291,6 @@ WERROR smbconf_get_global_parameter(struct smbconf_ctx *ctx,
 WERROR smbconf_delete_parameter(struct smbconf_ctx *ctx,
 				const char *service, const char *param)
 {
-	if (!smbconf_share_exists(ctx, service)) {
-		return WERR_NO_SUCH_SERVICE;
-	}
-
 	return ctx->ops->delete_parameter(ctx, service, param);
 }
 
@@ -316,10 +317,6 @@ WERROR smbconf_get_includes(struct smbconf_ctx *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);
 }
@@ -343,10 +340,6 @@ 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);
 }
 
@@ -368,10 +361,6 @@ WERROR smbconf_set_global_includes(struct smbconf_ctx *ctx,
 
 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);
 }
 
@@ -386,3 +375,18 @@ WERROR smbconf_delete_global_includes(struct smbconf_ctx *ctx)
 
 	return werr;
 }
+
+WERROR smbconf_transaction_start(struct smbconf_ctx *ctx)
+{
+	return ctx->ops->transaction_start(ctx);
+}
+
+WERROR smbconf_transaction_commit(struct smbconf_ctx *ctx)
+{
+	return ctx->ops->transaction_commit(ctx);
+}
+
+WERROR smbconf_transaction_cancel(struct smbconf_ctx *ctx)
+{
+	return ctx->ops->transaction_cancel(ctx);
+}
diff --git a/source/lib/smbconf/smbconf.h b/source/lib/smbconf/smbconf.h
index e337476..517302a 100644
--- a/source/lib/smbconf/smbconf.h
+++ b/source/lib/smbconf/smbconf.h
@@ -34,28 +34,11 @@ struct smbconf_service {
 	char **param_values;
 };
 
-
-/**
- * intialization dispatcher function.
- * takes source string in the form of "backend:path"
- */
-WERROR smbconf_init(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
-		    const char *source);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list