summaryrefslogtreecommitdiff
path: root/source3/utils/net_sam.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-01-22 12:12:43 +0100
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:30 +0200
commitd923907ced67b349013041327aef2d915c476102 (patch)
tree9b6db4b86ddc6b3f934ecbd00f2293cebef20647 /source3/utils/net_sam.c
parentc45eca5751fe7b50106d77b5421c1169338c27e1 (diff)
downloadsamba-d923907ced67b349013041327aef2d915c476102.tar.gz
s3:net sam provision: allocate the uid after composing the sid for Administrator
Michael
Diffstat (limited to 'source3/utils/net_sam.c')
-rw-r--r--source3/utils/net_sam.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index e02837fbc61..bd88a526029 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);