From d923907ced67b349013041327aef2d915c476102 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 22 Jan 2009 12:12:43 +0100 Subject: s3:net sam provision: allocate the uid after composing the sid for Administrator Michael --- source3/utils/net_sam.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/utils') 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); -- cgit