[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-3159-g75be211

Michael Adam obnox at samba.org
Wed Jul 9 08:43:42 GMT 2008


The branch, v3-3-test has been updated
       via  75be2116ac2589aaf69038a4115197f40e4b16a5 (commit)
       via  d7ec9b2d52d1eddd98eba222f723fb6cdff4541f (commit)
      from  2dab9ad77954dc608f8910bf4d3cb92fcaad5cb6 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 75be2116ac2589aaf69038a4115197f40e4b16a5
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 9 10:40:39 2008 +0200

    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

commit d7ec9b2d52d1eddd98eba222f723fb6cdff4541f
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jul 9 10:39:00 2008 +0200

    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

-----------------------------------------------------------------------

Summary of changes:
 source/registry/reg_backend_db.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/registry/reg_backend_db.c b/source/registry/reg_backend_db.c
index b1e3e2b..e0a7277 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 */
@@ -716,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);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list