From f587e0310c802109f2647fc8637db4b01c6a49d3 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 9 Jul 2008 10:40:39 +0200 Subject: registry: fix logic in deleting subkeys record in regdb_fetch_keys(). 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 (This used to be commit 75be2116ac2589aaf69038a4115197f40e4b16a5) --- source3/registry/reg_backend_db.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 3f06fba5c2..e0a7277a5d 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -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); -- cgit