]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
registry: regdb_store_keys: move storing the subkey list down after removing values.
authorMichael Adam <obnox@samba.org>
Thu, 8 May 2008 12:33:02 +0000 (14:33 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 8 May 2008 16:29:10 +0000 (18:29 +0200)
Michael
(This used to be commit 986030cdda828f7f87c5464d1837324b7033e27e)

source3/registry/reg_backend_db.c

index 87837448d91ccb8a41ec9c4f25763c70ea378ab9..182a7ba694842c9f85bb622847e5794e06eeb58b 100644 (file)
@@ -657,14 +657,6 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr)
         * out of the blue when re-adding keys later on.
         */
 
-       /* store the subkey list for the parent */
-
-       if (!regdb_store_keys_internal(key, ctr) ) {
-               DEBUG(0,("regdb_store_keys: Failed to store new subkey list "
-                        "for parent [%s]\n", key));
-               goto cancel;
-       }
-
        /* now delete removed keys */
 
        num_subkeys = regsubkey_ctr_numkeys(old_subkeys);
@@ -715,6 +707,14 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr)
 
        TALLOC_FREE(old_subkeys);
 
+       /* (2) store the subkey list for the parent */
+
+       if (!regdb_store_keys_internal(key, ctr) ) {
+               DEBUG(0,("regdb_store_keys: Failed to store new subkey list "
+                        "for parent [%s]\n", key));
+               goto cancel;
+       }
+
        /* now create records for any subkeys that don't already exist */
 
        num_subkeys = regsubkey_ctr_numkeys(ctr);