diff options
-rw-r--r-- | source3/utils/net_sam.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index 8a9ca8ad18..af8aaa47df 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -1781,6 +1781,13 @@ doma_done: "Admins group not available!\n")); goto done; } + if (!winbind_allocate_uid(&uid)) { + d_fprintf(stderr, + _("Unable to allocate a new uid to create " + "the Administrator user!\n")); + goto done; + } + name = talloc_strdup(tc, "Administrator"); dn = talloc_asprintf(tc, "uid=Administrator,%s", lp_ldap_user_suffix()); uidstr = talloc_asprintf(tc, "%u", (unsigned int)uid); @@ -1801,13 +1808,6 @@ doma_done: sid_compose(&sid, get_global_sam_sid(), DOMAIN_RID_ADMINISTRATOR); - if (!winbind_allocate_uid(&uid)) { - d_fprintf(stderr, - _("Unable to allocate a new uid to create " - "the Administrator user!\n")); - goto done; - } - smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_ACCOUNT); smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_POSIXACCOUNT); smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_SAMBASAMACCOUNT); |