diff options
author | Michael Adam <obnox@samba.org> | 2009-07-08 12:32:48 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-07-15 14:01:50 +0200 |
commit | 302265aae1bc27244ffaa9d803a8be83947e0381 (patch) | |
tree | 77e2e681a894aed23762fa8625f16bd81cfc01f8 /source3/registry | |
parent | 8a5b164b20c3d51df2422c1402ef31384b31472e (diff) | |
download | samba-302265aae1bc27244ffaa9d803a8be83947e0381.tar.gz samba-302265aae1bc27244ffaa9d803a8be83947e0381.tar.bz2 samba-302265aae1bc27244ffaa9d803a8be83947e0381.zip |
s3:registry: add a regdb_fetch_values_internal() that takes a db_context argument
Michael
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_backend_db.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 74671a0790..a5e882e9dc 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -33,6 +33,8 @@ static int regdb_fetch_keys_internal(struct db_context *db, const char *key, struct regsubkey_ctr *ctr); static bool regdb_store_keys_internal(struct db_context *db, const char *key, struct regsubkey_ctr *ctr); +static int regdb_fetch_values_internal(struct db_context *db, const char* key, + struct regval_ctr *values); /* List the deepest path into the registry. All part components will be created.*/ @@ -261,7 +263,9 @@ WERROR init_registry_data(void) goto done; } - regdb_fetch_values(builtin_registry_values[i].path, values); + regdb_fetch_values_internal(regdb, + builtin_registry_values[i].path, + values); if (!regval_ctr_key_exists(values, builtin_registry_values[i].valuename)) { @@ -315,7 +319,9 @@ do_init: goto fail; } - regdb_fetch_values(builtin_registry_values[i].path, values); + regdb_fetch_values_internal(regdb, + builtin_registry_values[i].path, + values); /* preserve existing values across restarts. Only add new ones */ @@ -1495,7 +1501,8 @@ static int regdb_pack_values(struct regval_ctr *values, uint8 *buf, int buflen) released by the caller. ***********************************************************************/ -int regdb_fetch_values(const char* key, struct regval_ctr *values) +static int regdb_fetch_values_internal(struct db_context *db, const char* key, + struct regval_ctr *values) { char *keystr = NULL; TALLOC_CTX *ctx = talloc_stackframe(); @@ -1504,7 +1511,7 @@ int regdb_fetch_values(const char* key, struct regval_ctr *values) DEBUG(10,("regdb_fetch_values: Looking for value of key [%s] \n", key)); - if (!regdb_key_exists(regdb, key)) { + if (!regdb_key_exists(db, key)) { goto done; } @@ -1513,9 +1520,9 @@ int regdb_fetch_values(const char* key, struct regval_ctr *values) goto done; } - values->seqnum = regdb_get_seqnum(); + values->seqnum = db->get_seqnum(db); - value = regdb_fetch_key_internal(regdb, ctx, keystr); + value = regdb_fetch_key_internal(db, ctx, keystr); if (!value.dptr) { /* all keys have zero values by default */ @@ -1530,6 +1537,11 @@ done: return ret; } +int regdb_fetch_values(const char* key, struct regval_ctr *values) +{ + return regdb_fetch_values_internal(regdb, key, values); +} + bool regdb_store_values(const char *key, struct regval_ctr *values) { TDB_DATA old_data, data; |