diff options
author | Michael Adam <obnox@samba.org> | 2008-07-09 10:39:00 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-07-09 10:43:25 +0200 |
commit | ad2e1757e7368fd47cada55b5004fec569b18768 (patch) | |
tree | 9576b9e7a245af9fe4548e5587ab314c7a1e8f5e /source3/registry | |
parent | 8c9bbbae96c247f9c05f085f771d30573e41c687 (diff) | |
download | samba-ad2e1757e7368fd47cada55b5004fec569b18768.tar.gz samba-ad2e1757e7368fd47cada55b5004fec569b18768.tar.bz2 samba-ad2e1757e7368fd47cada55b5004fec569b18768.zip |
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
(This used to be commit d7ec9b2d52d1eddd98eba222f723fb6cdff4541f)
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_backend_db.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index b1e3e2b5a3..3f06fba5c2 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/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 */ |