From: Michael Adam Date: Wed, 9 Jul 2008 08:39:00 +0000 (+0200) Subject: registry: improve logic for deleting value records in regdb_store_keys(). X-Git-Tag: samba-3.3.0pre1~608 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7ec9b2d52d1eddd98eba222f723fb6cdff4541f;p=thirdparty%2Fsamba.git registry: improve logic for deleting value records in regdb_store_keys(). Don't ignore all errors from dbwrap_delete_bystring() but only NT_STATUS_NOT_FOUND. Michael --- diff --git a/source/registry/reg_backend_db.c b/source/registry/reg_backend_db.c index b1e3e2b5a3c..3f06fba5c2b 100644 --- a/source/registry/reg_backend_db.c +++ b/source/registry/reg_backend_db.c @@ -701,8 +701,15 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr) if (!path) { goto cancel; } - /* Ignore errors here, we might have no values around */ - dbwrap_delete_bystring(regdb, path); + status = dbwrap_delete_bystring(regdb, path); + /* Don't fail if there are no values around. */ + 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); /* (c) Delete the list of subkeys of this key */