]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
registry: fix logic in deleting subkeys record in regdb_fetch_keys().
authorMichael Adam <obnox@samba.org>
Wed, 9 Jul 2008 08:40:39 +0000 (10:40 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 9 Jul 2008 08:43:25 +0000 (10:43 +0200)
Don't cancel on NT_STATUS_NOT_FOUND error from dbwrap_delete_bystring().
So deletion of an "incomlete" registry key, i.e. one with an entry in
the list of subkeys of its parent key but not a subkey list of its own,
works again.

Michael

source/registry/reg_backend_db.c

index 3f06fba5c2b71928f4dc268d3b0d07195bcf7d72..e0a7277a5d432ea1f61559775acc21453644e1f1 100644 (file)
@@ -723,8 +723,12 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr)
                        goto cancel;
                }
                status = dbwrap_delete_bystring(regdb, path);
-               if (!NT_STATUS_IS_OK(status)) {
-                       DEBUG(1, ("Deleting %s failed\n", path));
+               /* Don't fail if the subkey record was not found. */
+               if (!NT_STATUS_IS_OK(status) &&
+                   !NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND))
+               {
+                       DEBUG(1, ("Deleting %s failed: %s\n", path,
+                                 nt_errstr(status)));
                        goto cancel;
                }
                TALLOC_FREE(path);