registry: add removal of secdesc of a key to regdb_store_keys().
authorMichael Adam <obnox@samba.org>
Thu, 8 May 2008 16:08:41 +0000 (18:08 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 8 May 2008 16:29:10 +0000 (18:29 +0200)
Michael
(This used to be commit a01d8fe5e89ca9620d23198b11e5ae605a97e5a6)

source3/registry/reg_backend_db.c

index 8de10a0b1f4246472207bf3a101ae7e9aca6fa98..0d976be10d47adb4364e757c47546f561c1102e8 100644 (file)
@@ -688,6 +688,23 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr)
                dbwrap_delete_bystring(regdb, path);
                TALLOC_FREE(path);
 
+               /* (b) Delete the secdesc for this key */
+
+               path = talloc_asprintf(ctx, "%s/%s/%s",
+                               REG_SECDESC_PREFIX,
+                               key,
+                               oldkeyname );
+               if (!path) {
+                       goto cancel;
+               }
+               path = normalize_reg_path(ctx, path);
+               if (!path) {
+                       goto cancel;
+               }
+               /* Ignore errors here, we might have no values around */
+               dbwrap_delete_bystring(regdb, path);
+               TALLOC_FREE(path);
+
                /* (c) Delete the list of subkeys of this key */
 
                path = talloc_asprintf(ctx, "%s/%s", key, oldkeyname);