s3:registry: remove redundant write of zero-lentgh subkey list record
authorMichael Adam <obnox@samba.org>
Fri, 1 Jul 2011 13:18:12 +0000 (15:18 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 9 Aug 2011 14:57:53 +0000 (16:57 +0200)
In this case, the zero-lenght list has already been written in step #2.

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
(cherry picked from commit 394ca1446e712c9cb3649c8a2c4fd2ebe638d8cd)

source3/registry/reg_backend_db.c

index d85a8e0654abebaea67f83932892cc0fea4e7c1c..cade9364b5a1afee4fa5af0d52dfe72a9a0a1246 100644 (file)
@@ -953,20 +953,6 @@ static NTSTATUS regdb_store_keys_action(struct db_context *db,
 
        num_subkeys = regsubkey_ctr_numkeys(store_ctx->ctr);
 
-       if (num_subkeys == 0) {
-               werr = regsubkey_ctr_init(mem_ctx, &subkeys);
-               W_ERROR_NOT_OK_GOTO_DONE(werr);
-
-               werr = regdb_store_keys_internal2(db, store_ctx->key, subkeys);
-               if (!W_ERROR_IS_OK(werr)) {
-                       DEBUG(0,("regdb_store_keys: Failed to store "
-                                "new record for key [%s]: %s\n",
-                                store_ctx->key, win_errstr(werr)));
-                       goto done;
-               }
-               TALLOC_FREE(subkeys);
-       }
-
        for (i=0; i<num_subkeys; i++) {
                path = talloc_asprintf(mem_ctx, "%s\\%s", store_ctx->key,
                                regsubkey_ctr_specific_key(store_ctx->ctr, i));