summaryrefslogtreecommitdiff
path: root/source3/registry/reg_db.c
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@altlinux.org>2008-01-14 21:40:40 +0300
committerAlexander Bokovoy <ab@altlinux.org>2008-01-14 21:40:40 +0300
commitd7a406eaa78273e0efa0ce71a9ced5f06e537aab (patch)
tree49f405f43e5297a2f3ea52c633ff1bcecdf282c6 /source3/registry/reg_db.c
parent978eb313448fe9612db5491385a91dd3b67d0e97 (diff)
parentd35bda0ffd5bea57087dba9a6da8c20df8fa165c (diff)
downloadsamba-d7a406eaa78273e0efa0ce71a9ced5f06e537aab.tar.gz
samba-d7a406eaa78273e0efa0ce71a9ced5f06e537aab.tar.bz2
samba-d7a406eaa78273e0efa0ce71a9ced5f06e537aab.zip
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
(This used to be commit 5c2d4c76d8b56be92edcee026f2289b8b46a4c27)
Diffstat (limited to 'source3/registry/reg_db.c')
-rw-r--r--source3/registry/reg_db.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/source3/registry/reg_db.c b/source3/registry/reg_db.c
index f50a41816c..c4bfc2b6c9 100644
--- a/source3/registry/reg_db.c
+++ b/source3/registry/reg_db.c
@@ -622,7 +622,15 @@ int regdb_fetch_keys(const char *key, REGSUBKEY_CTR *ctr)
}
strupper_m(path);
+ if (tdb_read_lock_bystring_with_timeout(tdb_reg->tdb, path, 10) == -1) {
+ return 0;
+ }
+
dbuf = tdb_fetch_bystring(tdb_reg->tdb, path);
+ ctr->seqnum = regdb_get_seqnum();
+
+ tdb_read_unlock_bystring(tdb_reg->tdb, path);
+
buf = dbuf.dptr;
buflen = dbuf.dsize;
@@ -750,7 +758,14 @@ int regdb_fetch_values( const char* key, REGVAL_CTR *values )
return 0;
}
+ if (tdb_read_lock_bystring_with_timeout(tdb_reg->tdb, keystr, 10) == -1) {
+ return 0;
+ }
+
data = tdb_fetch_bystring(tdb_reg->tdb, keystr);
+ values->seqnum = regdb_get_seqnum();
+
+ tdb_read_unlock_bystring(tdb_reg->tdb, keystr);
if (!data.dptr) {
/* all keys have zero values by default */
@@ -907,6 +922,16 @@ static WERROR regdb_set_secdesc(const char *key,
return err;
}
+bool regdb_subkeys_need_update(REGSUBKEY_CTR *subkeys)
+{
+ return (regdb_get_seqnum() != subkeys->seqnum);
+}
+
+bool regdb_values_need_update(REGVAL_CTR *values)
+{
+ return (regdb_get_seqnum() != values->seqnum);
+}
+
/*
* Table of function pointers for default access
*/
@@ -918,5 +943,7 @@ REGISTRY_OPS regdb_ops = {
regdb_store_values,
NULL,
regdb_get_secdesc,
- regdb_set_secdesc
+ regdb_set_secdesc,
+ regdb_subkeys_need_update,
+ regdb_values_need_update
};