autorid: initialize: store config directly before allocating well knowns.
authorMichael Adam <obnox@samba.org>
Wed, 19 Mar 2014 22:50:20 +0000 (23:50 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 2 Apr 2014 22:26:28 +0000 (00:26 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/idmap_autorid.c

index 35b4b68ba56f374d7b30b048760c7336b6fe6958..963d73b0e4859a416ada0521db83cdc927be96d5 100644 (file)
@@ -641,13 +641,6 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
                          config->maxranges));
        }
 
-       status = idmap_autorid_saveconfig(autorid_db, config);
-
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(1, ("Failed to store configuration data!\n"));
-               goto error;
-       }
-
        DEBUG(5, ("%d domain ranges with a size of %d are available\n",
                  config->maxranges, config->rangesize));
 
@@ -666,6 +659,12 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
 
        dom->private_data = commonconfig;
 
+       status = idmap_autorid_saveconfig(autorid_db, config);
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(1, ("Failed to store configuration data!\n"));
+               goto error;
+       }
+
        /* preallocate well-known SIDs in the pool */
        status = idmap_autorid_preallocate_wellknown(dom);