1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

838 Commits

Author SHA1 Message Date
Christian Ambach
47f8e21043 s3:registry increase a debug level
do not clutter the logs

Reviewed-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Christian Ambach <ambi@samba.org>
2013-04-19 13:16:38 +02:00
Gregor Beck
f7564cae4c s3:registry accept windows like long hivenames
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Mar 20 17:08:52 CET 2013 on sn-devel-104
2013-03-20 17:08:51 +01:00
Andreas Schneider
76ac4d923d s3-registry: Fix counters_directory() dir creation.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 15:00:02 +01:00
Andreas Schneider
ff32391808 s3-registry: Check return code of push_reg_sz().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2012-12-12 09:42:32 +01:00
Andreas Schneider
aa7f406317 s3-reg: Fix copy and paste error in debug message.
Found by coverity.
2012-11-30 14:02:53 +01:00
Andrew Bartlett
3902e7332d lib/util/charset: We do not use fucntions from wchar.h any more
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep 26 02:13:10 CEST 2012 on sn-devel-104
2012-09-26 02:13:10 +02:00
Björn Jacke
cbcfd85f41 s3/registry: fix compile warning on openindiana 2012-08-23 16:43:48 +02:00
Jeremy Allison
526e875cec Check error returns from strupper_m() (in all reasonable places). 2012-08-09 12:06:54 -07:00
David Binderman
d58aa46c08 Fix bug 9065: source3/registry/regfio.c: bad call to memcpy
Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul 25 02:42:32 CEST 2012 on sn-devel-104
2012-07-25 02:42:32 +02:00
Rusty Russell
15faffc537 source3/registry/reg_backend_db.c: fix stackframe leak
regdb_store_values_internal() doesn't always free its stackframe.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 05:06:31 +09:30
Michael Adam
5ba91fff94 s3:registry: untangle assignment from check in reg_enumkey()
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jul  5 17:57:16 CEST 2012 on sn-devel-104
2012-07-05 17:57:16 +02:00
Michael Adam
e481afc0fe s3:registry: untangle assignment from check in reg_enumvalue() 2012-07-05 16:07:40 +02:00
Michael Adam
dba03a644d s3:registry: change reg_import.c according to coding guidelines.
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Jun 27 10:07:54 CEST 2012 on sn-devel-104
2012-06-27 10:07:54 +02:00
Michael Adam
7bc1172c5f s3:registry: use TALLOC_CTX * instead of const void * in reg_import_adapter() 2012-06-27 08:18:18 +02:00
Gregor Beck
e78d647ebc s3:registry: add function registry_value_cmp()
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-26 19:57:19 +02:00
Gregor Beck
55ce9e1fa9 s3:registry: fix possible double free in import
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-26 19:57:18 +02:00
Gregor Beck
619f0c07ff s3:registry: improve debug output in reg_parse
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-26 19:57:18 +02:00
Gregor Beck
e10ea2b3cd s3:registry: add functions to conveniently create registry_values
Pair-Programmed-With: Michael Adam <obnox@samba.org>
2012-06-26 19:57:18 +02:00
Gregor Beck
35eccd0f53 s3:registry: silence net_deletekey_recursive
WERR_BADFILE may not be an error for the caller because the result is the same.

Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-26 19:57:18 +02:00
Michael Adam
fb706c7365 s3:registry: make reg_delete_path() delete the path recursively.
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
(cherry picked from commit a56992ab71032b54d9879834c12f6b88e6174cb4)
2012-06-26 19:57:18 +02:00
Gregor Beck
353f614c96 s3:registry: compile reg_create_path() & reg_delete_path()
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-26 19:57:18 +02:00
Volker Lendecke
64fec465c1 dbwrap: dbwrap_trans_store_int32->dbwrap_trans_store_int32_bystring
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15 12:14:29 +02:00
Volker Lendecke
737c0a5473 dbwrap: dbwrap_fetch_int32->dbwrap_fetch_int32_bystring
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-15 12:14:27 +02:00
Michael Adam
4754743860 s3:registry: let reg_values_need_update() return true if the backend does not implement the method
Otherwise the value cache might become outdated.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon May  7 16:11:05 CEST 2012 on sn-devel-104
2012-05-07 16:11:05 +02:00
Michael Adam
fb58951f93 s3:registry: let reg_subkeys_need_update() return true if the backend does not implement the method
Otherwise the subkey cache might become outdated.
2012-05-07 14:09:09 +02:00
Michael Adam
16a24dc182 s3:registry: implement values_need_update and subkeys_need_update in the smbconf backend
It simply calls to the regdb functions.
This fixes a caching issue uncovered by recent changes.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Sat May  5 04:10:43 CEST 2012 on sn-devel-104
2012-05-05 04:10:42 +02:00
Michael Adam
cd98954c6d s3:registry: return error when Key does not exist in regdb_fetch_values_internal() 2012-05-05 02:22:00 +02:00
Volker Lendecke
05456aca34 s3: Remove an unused variable
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Apr 26 12:17:14 CEST 2012 on sn-devel-104
2012-04-26 12:17:13 +02:00
Michael Adam
c333885fa1 s3:registry: replace call to reg_openkey() in reg_createkey() by accesscheck.
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
7f205bcbf2 s3:registry: remove a superfluous fill_subkey_cache() in reg_createkey()
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
4b7817aa80 s3:registry: use fill_subkey_cache to check exsistence in regkey_open_onelevel().
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
be2cb08e40 s3:registry: let fill_subkey_cache return WERR_BADFILE when the subkey list could not be loaded
WERR_NO_MORE_ITEMS seems inappropriate.

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
1703e6fe09 s3:registry: convert reg_openkey() to use talloc instead of SMB_STRDUP etc
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
323ec9f9b4 s3:registry untangle an assignment from the check in regkey_open_onelevel()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:12 +02:00
Michael Adam
640cecab19 s3:registry: untangle assignment from check in regkey_open_onelevel()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
22451f7f45 s3:registry: fix seqnum race in regdb_fetch_keys_internal
This prevents race between fetching seqnum and key content.

Because there is currently no way to atomically fetch the
record along with the seqnum, I use a loop.
This is far from optimal and should should ideally be done
differently. But for now it fixes the race.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
7ea8bd3605 s3:registry: fix seqnum race in fetch_values_internal
This prevents race between fetching seqnum and key content.

Because there is currently no way to atomically fetch the
record along with the seqnum, I use a loop.
This is far from optimal and should should ideally be done
differently. But for now it fixes the race.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
ab83005b30 s3:registry: update the seqnum in the subkey cache at the end of regval_store_keys
The purpose is to prevent next reads from going to disk.

Note that this will currently only be effective with local tdbs, not
with ctdb: For tdb, store and delete bump the seqnum while transaction
commit does not. For ctdb, transaction commit bumps the seqnum, while
store and delete don't... This needs fixing (in ctdb).

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
4367071f62 s3:registry:db: update the value container seqnum after storing/deleting to prevent next read from going to disk if possible
Note that this will currently only be effective in the local TDB implementation.
For CTDB, this wont work since seqnum currently works differently there (needs
fixing): For tdb, store and delete operations bump the db seqnum, while
transaction commits don't. For ctdb, the seqnum is bumped by the transaction
commit but not by store and delete operations.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
8c7047b0e7 s3:registry: wrap reg_deletekey() into a transaction
This is wrong layering but fixes a race condition.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:11 +02:00
Michael Adam
32ac4f4b34 s3:registry: wrap reg_createkey() in a transaction
This is wrong layering (calling into regdb_transaction* in the reg_api code)
but fixes a potential race. It makes the multi-step create procedure atomic.

This should completely be done in the backend.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
1af68be008 s3:registry: untangle assignments from checks in reg_createkey()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
8d19ac7474 s3:registry: wrap reg_deletevalue() in a transaction
This is at the wrong layer, but if fixes a race potentially causing
data corruption by concurrent access.

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
97bf05871a s3:registry: untangle assignment from check in reg_deletevalue()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
8ddc2aa0e1 s3:registry: fix race in reg_setvalue that could lead to data corruption
(there was no lock around fetching the values and storing them)

The layering is wrong in that it uses regdb transactions in reg_api

Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
705ea5b8c2 s3:registry: untangle assignment from check and add a debugmessage in reg_setvalue()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:10 +02:00
Michael Adam
04aa303fb1 s3:registry: don't leak the old contents when updating the value cache
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:09 +02:00
Michael Adam
f4747250ea s3:registry: fix debug message in regdb_store_values_internal()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:09 +02:00
Michael Adam
44159330db s3:registry: improve log message in regdb_unpack_values()
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:09 +02:00
Michael Adam
6f67f5d5b7 s3:registry: fix a debug message typo
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25 14:31:09 +02:00