From: Michael Adam Date: Wed, 9 Jul 2008 08:40:39 +0000 (+0200) Subject: registry: fix logic in deleting subkeys record in regdb_fetch_keys(). X-Git-Tag: samba-3.3.0pre1~607 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=75be2116ac2589aaf69038a4115197f40e4b16a5;p=thirdparty%2Fsamba.git 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 --- diff --git a/source/registry/reg_backend_db.c b/source/registry/reg_backend_db.c index 3f06fba5c2b..e0a7277a5d4 100644 --- a/source/registry/reg_backend_db.c +++ b/source/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);