s3:registry: add db_context argument to regdb_store_keys_internal()
[ira/wip.git] / source3 / registry / reg_backend_db.c
index 700db0140f794e28482568a2c1f7bb37269f3ca1..f4a269ef4610cea86cfb75afdd0d9c361075ada5 100644 (file)
@@ -601,7 +601,9 @@ done:
  fstrings
  ***********************************************************************/
 
-static bool regdb_store_keys_internal(const char *key, struct regsubkey_ctr *ctr)
+static bool regdb_store_keys_internal(struct db_context *db,
+                                     const char *key,
+                                     struct regsubkey_ctr *ctr)
 {
        TDB_DATA dbuf;
        uint8 *buffer = NULL;
@@ -675,7 +677,7 @@ static bool regdb_store_keys_internal(const char *key, struct regsubkey_ctr *ctr
 
        dbuf.dptr = buffer;
        dbuf.dsize = len;
-       status = dbwrap_store_bystring(regdb, keyname, dbuf, TDB_REPLACE);
+       status = dbwrap_store_bystring(db, keyname, dbuf, TDB_REPLACE);
        if (!NT_STATUS_IS_OK(status)) {
                ret = false;
                goto done;
@@ -688,7 +690,7 @@ static bool regdb_store_keys_internal(const char *key, struct regsubkey_ctr *ctr
        keyname = talloc_asprintf(ctx, "%s/%s", REG_SORTED_SUBKEYS_PREFIX,
                                  keyname);
        if (keyname != NULL) {
-               dbwrap_delete_bystring(regdb, keyname);
+               dbwrap_delete_bystring(db, keyname);
        }
 
 done:
@@ -820,7 +822,7 @@ bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr)
 
        /* (2) store the subkey list for the parent */
 
-       if (!regdb_store_keys_internal(key, ctr) ) {
+       if (!regdb_store_keys_internal(regdb, key, ctr)) {
                DEBUG(0,("regdb_store_keys: Failed to store new subkey list "
                         "for parent [%s]\n", key));
                goto cancel;
@@ -837,7 +839,7 @@ bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr)
                        goto cancel;
                }
 
-               if (!regdb_store_keys_internal(key, subkeys)) {
+               if (!regdb_store_keys_internal(regdb, key, subkeys)) {
                        DEBUG(0,("regdb_store_keys: Failed to store "
                                 "new record for key [%s]\n", key));
                        goto cancel;
@@ -861,7 +863,7 @@ bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr)
 
                if (regdb_fetch_keys( path, subkeys ) == -1) {
                        /* create a record with 0 subkeys */
-                       if (!regdb_store_keys_internal(path, subkeys)) {
+                       if (!regdb_store_keys_internal(regdb, path, subkeys)) {
                                DEBUG(0,("regdb_store_keys: Failed to store "
                                         "new record for key [%s]\n", path));
                                goto cancel;
@@ -931,7 +933,7 @@ static WERROR regdb_create_subkey(const char *key, const char *subkey)
        werr = regsubkey_ctr_addkey(subkeys, subkey);
        W_ERROR_NOT_OK_GOTO(werr, cancel);
 
-       if (!regdb_store_keys_internal(key, subkeys)) {
+       if (!regdb_store_keys_internal(regdb, key, subkeys)) {
                DEBUG(0, (__location__ " failed to store new subkey list for "
                         "parent key %s\n", key));
                werr = WERR_REG_IO_FAILURE;
@@ -998,7 +1000,7 @@ static WERROR regdb_delete_subkey(const char *key, const char *subkey)
        werr = regsubkey_ctr_delkey(subkeys, subkey);
        W_ERROR_NOT_OK_GOTO(werr, cancel);
 
-       if (!regdb_store_keys_internal(key, subkeys)) {
+       if (!regdb_store_keys_internal(regdb, key, subkeys)) {
                DEBUG(0, (__location__ " failed to store new subkey_list for "
                         "parent key %s\n", key));
                werr = WERR_REG_IO_FAILURE;