s3:registry: add regdb_create_subkey_internal() taking additional db context argument
authorMichael Adam <obnox@samba.org>
Mon, 4 Jul 2011 11:09:31 +0000 (13:09 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 4 Jul 2011 18:02:08 +0000 (20:02 +0200)
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

source3/registry/reg_backend_db.c

index efb2b46b88713d05202d27097b7c7dda81294597..84ac57216b1058927c028188467a0222c98fce38 100644 (file)
@@ -1143,14 +1143,16 @@ done:
        return werror_to_ntstatus(werr);
 }
 
-static WERROR regdb_create_subkey(const char *key, const char *subkey)
+static WERROR regdb_create_subkey_internal(struct db_context *db,
+                                          const char *key,
+                                          const char *subkey)
 {
        WERROR werr;
        struct regsubkey_ctr *subkeys;
        TALLOC_CTX *mem_ctx = talloc_stackframe();
        struct regdb_create_subkey_context create_ctx;
 
-       if (!regdb_key_exists(regdb, key)) {
+       if (!regdb_key_exists(db, key)) {
                werr = WERR_NOT_FOUND;
                goto done;
        }
@@ -1158,7 +1160,7 @@ static WERROR regdb_create_subkey(const char *key, const char *subkey)
        werr = regsubkey_ctr_init(mem_ctx, &subkeys);
        W_ERROR_NOT_OK_GOTO_DONE(werr);
 
-       werr = regdb_fetch_keys_internal(regdb, key, subkeys);
+       werr = regdb_fetch_keys_internal(db, key, subkeys);
        W_ERROR_NOT_OK_GOTO_DONE(werr);
 
        if (regsubkey_ctr_key_exists(subkeys, subkey)) {
@@ -1171,7 +1173,7 @@ static WERROR regdb_create_subkey(const char *key, const char *subkey)
        create_ctx.key = key;
        create_ctx.subkey = subkey;
 
-       werr = ntstatus_to_werror(dbwrap_trans_do(regdb,
+       werr = ntstatus_to_werror(dbwrap_trans_do(db,
                                                  regdb_create_subkey_action,
                                                  &create_ctx));
 
@@ -1180,6 +1182,11 @@ done:
        return werr;
 }
 
+static WERROR regdb_create_subkey(const char *key, const char *subkey)
+{
+       return regdb_create_subkey_internal(regdb, key, subkey);
+}
+
 /**
  * create a subkey of a given key
  */