summaryrefslogtreecommitdiff
path: root/source3/registry
AgeCommit message (Collapse)AuthorFilesLines
2012-04-26s3: Remove an unused variableVolker Lendecke1-1/+0
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Thu Apr 26 12:17:14 CEST 2012 on sn-devel-104
2012-04-25s3:registry: replace call to reg_openkey() in reg_createkey() by accesscheck.Michael Adam1-8/+10
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: remove a superfluous fill_subkey_cache() in reg_createkey()Michael Adam1-5/+0
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de> Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: use fill_subkey_cache to check exsistence in ↵Michael Adam1-11/+2
regkey_open_onelevel(). Pair-Programmed-With: Gregor Beck <gbeck@sernet.de> Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: let fill_subkey_cache return WERR_BADFILE when the subkey list ↵Michael Adam1-1/+1
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-25s3:registry: convert reg_openkey() to use talloc instead of SMB_STRDUP etcMichael Adam1-15/+12
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry untangle an assignment from the check in regkey_open_onelevel()Michael Adam1-1/+2
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: untangle assignment from check in regkey_open_onelevel()Michael Adam1-1/+2
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: fix seqnum race in regdb_fetch_keys_internalMichael Adam1-3/+22
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-25s3:registry: fix seqnum race in fetch_values_internalMichael Adam1-3/+21
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-25s3:registry: update the seqnum in the subkey cache at the end of ↵Michael Adam1-1/+5
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-25s3:registry:db: update the value container seqnum after storing/deleting to ↵Michael Adam1-1/+22
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-25s3:registry: wrap reg_deletekey() into a transactionMichael Adam1-2/+25
This is wrong layering but fixes a race condition. Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: wrap reg_createkey() in a transactionMichael Adam1-6/+30
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-25s3:registry: untangle assignments from checks in reg_createkey()Michael Adam1-2/+6
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: wrap reg_deletevalue() in a transactionMichael Adam1-4/+30
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-25s3:registry: untangle assignment from check in reg_deletevalue()Michael Adam1-1/+2
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: fix race in reg_setvalue that could lead to data corruptionMichael Adam1-6/+33
(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-25s3:registry: untangle assignment from check and add a debugmessage in ↵Michael Adam1-1/+3
reg_setvalue() Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: don't leak the old contents when updating the value cacheMichael Adam1-0/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: fix debug message in regdb_store_values_internal()Michael Adam1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: improve log message in regdb_unpack_values()Michael Adam1-1/+2
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: fix a debug message typoMichael Adam1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: add a new function regval_ctr_value_byname()Michael Adam2-0/+20
This is like regval_ctr_key_exists() but does not return bool, but the regval_blob instead, if found, and NULL if not found. Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: rename regval_ctr_key_exists() to regval_ctr_value_exists()Michael Adam3-4/+4
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry:reg_api: fix reg_queryvalue to not fail when values are modified ↵Michael Adam1-1/+45
while it runs Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: make regdb_values_need_update() staticMichael Adam2-2/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: make regdb_subkeys_need_update() staticMichael Adam2-2/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: make regdb_store_values() staticMichael Adam2-2/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: make regdb_fetch_values() staticMichael Adam2-2/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: make regdb_fetch_keys() staticMichael Adam2-2/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: make regdb_store_keys() staticMichael Adam2-2/+1
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-25s3:registry: printing backend: use regdb options via ops struct, not directlyMichael Adam1-9/+10
just like the other backends. This is in preparation of making the backend functions private Signed-off-by: Andreas Schneider <asn@samba.org>
2012-04-13Wrong assertion/comparison: Compare value not pointerOlaf Flebbe1-2/+2
Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Apr 13 02:23:36 CEST 2012 on sn-devel-104
2012-03-24adt_tree: Avoid WERROR.Jelmer Vernooij1-1/+4
2012-02-17s3-registry Remove unused dup_registry_value() and free_registry_value()Andrew Bartlett2-56/+0
2012-02-10s3-registry: Remove unused prs_uint8()Andrew Bartlett2-23/+0
Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html Andrew Bartlett
2012-01-24s3:registry: do not write empty value lists to registry.tdbGregor Beck1-0/+5
Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Tue Jan 24 13:54:09 CET 2012 on sn-devel-104
2012-01-18s3: Add a "lock_order" argument to db_openVolker Lendecke1-3/+6
This will be used to enforce a lock hierarchy between the databases. We have seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb. These should be fixed by refusing a dbwrap_fetch_locked that does not follow a defined lock hierarchy.
2012-01-04s3-perfcount: fix incorrect array length calculationsDavid Disseldorp1-9/+17
As reported by Ismail Doenmez (idonmez@suse.com), sizeof() is incorrectly used by _reg_perfcount_init_data_block() in an attempt to determine the length of a talloced array. Signed-off-by: Günther Deschner <gd@samba.org> Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Jan 4 16:54:37 CET 2012 on sn-devel-104
2011-12-20s3: Fix some False/NULL hickupsVolker Lendecke1-9/+9
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Dec 20 13:13:17 CET 2011 on sn-devel-104
2011-12-06s3:registry: replace use of rawmemchr by portable equivalent use of strchr.Michael Adam1-1/+1
2011-12-03lib/util: factor out tdb_data_is_emptyGregor Beck1-4/+0
Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Sat Dec 3 05:20:30 CET 2011 on sn-devel-104
2011-12-03s3:registry: do not use regdb functions during db upgradeGregor Beck1-55/+141
It is importante to not use the database backend implementation in the upgrade. Otherwise this would only work as long as this is the newset version. In future versions of the registry, this (then) intermediate upgrade step would change in behaviour and not work as expected any more. Signed-off-by: Michael Adam <obnox@samba.org>
2011-11-25s3:registry: write INFO/version if we create registry.tdbGregor Beck1-0/+7
Signed-off-by: Michael Adam <obnox@samba.org>
2011-11-09s3:registry: prevent unnecessary transactions in regdb_initMichael Adam1-0/+4
Skip the transaction for the upgrade code, if the database is already at code-level. Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Wed Nov 9 15:06:59 CET 2011 on sn-devel-104
2011-11-03s3-registry: fix upgrade codeBjörn Baumbach1-4/+18
Assume REGDB_VERSION_V1 if no version key found in registry.tdb Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-27replace: Add don't include unistd.h directly and add uid_wrapper.Andreas Schneider1-2/+0
2011-10-27s3: Include uid_wrapper where it is missing.Andreas Schneider1-0/+1
2011-10-12s3:registry add function srprs_hive()Gregor Beck3-38/+89
Signed-off-by: Michael Adam <obnox@samba.org>