summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-07-08 12:38:41 +0200
committerMichael Adam <obnox@samba.org>2009-07-15 14:01:51 +0200
commite6340963cf549cda261fc1ba9da4bc1b3a071241 (patch)
tree4c6de02801625fc40f39ce857e0b960882cad9fc
parent302265aae1bc27244ffaa9d803a8be83947e0381 (diff)
downloadsamba-e6340963cf549cda261fc1ba9da4bc1b3a071241.tar.gz
samba-e6340963cf549cda261fc1ba9da4bc1b3a071241.tar.bz2
samba-e6340963cf549cda261fc1ba9da4bc1b3a071241.zip
s3:registry: add regdb_store_values_internal() that takes a db_context argument
Michael
-rw-r--r--source3/registry/reg_backend_db.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index a5e882e9dc..d2adc1ce08 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -35,6 +35,8 @@ 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);
+static bool regdb_store_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.*/
@@ -354,8 +356,9 @@ do_init:
"[%d]\n",
builtin_registry_values[i].type));
}
- regdb_store_values(builtin_registry_values[i].path,
- values);
+ regdb_store_values_internal(regdb,
+ builtin_registry_values[i].path,
+ values);
}
TALLOC_FREE(values);
}
@@ -1542,7 +1545,8 @@ 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)
+static bool regdb_store_values_internal(struct db_context *db, const char *key,
+ struct regval_ctr *values)
{
TDB_DATA old_data, data;
char *keystr = NULL;
@@ -1553,7 +1557,7 @@ bool regdb_store_values(const char *key, struct regval_ctr *values)
DEBUG(10,("regdb_store_values: Looking for value of key [%s] \n", key));
- if (!regdb_key_exists(regdb, key)) {
+ if (!regdb_key_exists(db, key)) {
goto done;
}
@@ -1581,7 +1585,7 @@ bool regdb_store_values(const char *key, struct regval_ctr *values)
goto done;
}
- old_data = dbwrap_fetch_bystring(regdb, ctx, keystr);
+ old_data = dbwrap_fetch_bystring(db, ctx, keystr);
if ((old_data.dptr != NULL)
&& (old_data.dsize == data.dsize)
@@ -1591,7 +1595,7 @@ bool regdb_store_values(const char *key, struct regval_ctr *values)
goto done;
}
- status = dbwrap_trans_store_bystring(regdb, keystr, data, TDB_REPLACE);
+ status = dbwrap_trans_store_bystring(db, keystr, data, TDB_REPLACE);
result = NT_STATUS_IS_OK(status);
@@ -1600,6 +1604,11 @@ done:
return result;
}
+bool regdb_store_values(const char *key, struct regval_ctr *values)
+{
+ return regdb_store_values_internal(regdb, key, values);
+}
+
static WERROR regdb_get_secdesc(TALLOC_CTX *mem_ctx, const char *key,
struct security_descriptor **psecdesc)
{