diff options
-rw-r--r-- | source3/utils/net_sam.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index e02837fbc6..bd88a52602 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -1780,12 +1780,6 @@ 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); @@ -1806,6 +1800,13 @@ 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); |