diff options
author | Volker Lendecke <vl@samba.org> | 2018-12-09 12:22:50 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2018-12-11 00:40:30 +0100 |
commit | eaa035b8c4b936d751d916dadb7f541286382c9b (patch) | |
tree | 2aecfc9c55fc2a18a1c6c4508e788be7b48c920f | |
parent | de331ce92b4129615bd6f84a18ec605980d10f90 (diff) | |
download | samba-eaa035b8c4b936d751d916dadb7f541286382c9b.tar.gz |
net: Use dom_sid_str_buf
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source3/utils/net_sam.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index 9fe7b6330da..52d6515f014 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -1682,6 +1682,7 @@ static int net_sam_provision(struct net_context *c, int argc, const char **argv) } if (!pdb_getgrsid(gmap, gsid)) { + struct dom_sid_buf gsid_str; LDAPMod **mods = NULL; char *dn; char *uname; @@ -1726,7 +1727,7 @@ static int net_sam_provision(struct net_context *c, int argc, const char **argv) smbldap_set_mod(&mods, LDAP_MOD_ADD, "displayName", wname); smbldap_set_mod(&mods, LDAP_MOD_ADD, "gidNumber", gidstr); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSid", - sid_string_talloc(tc, &gsid)); + dom_sid_str_buf(&gsid, &gsid_str)); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaGroupType", gtype); smbldap_talloc_autofree_ldapmod(tc, mods); @@ -1759,6 +1760,7 @@ domu_done: sid_compose(&gsid, get_global_sam_sid(), DOMAIN_RID_ADMINS); if (!pdb_getgrsid(gmap, gsid)) { + struct dom_sid_buf gsid_str; LDAPMod **mods = NULL; char *dn; char *uname; @@ -1803,7 +1805,7 @@ domu_done: smbldap_set_mod(&mods, LDAP_MOD_ADD, "displayName", wname); smbldap_set_mod(&mods, LDAP_MOD_ADD, "gidNumber", gidstr); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSid", - sid_string_talloc(tc, &gsid)); + dom_sid_str_buf(&gsid, &gsid_str)); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaGroupType", gtype); smbldap_talloc_autofree_ldapmod(tc, mods); @@ -1842,6 +1844,7 @@ doma_done: if (!pdb_getsampwnam(samuser, "Administrator")) { LDAPMod **mods = NULL; struct dom_sid sid; + struct dom_sid_buf sid_str; char *dn; char *name; char *uidstr; @@ -1921,7 +1924,7 @@ doma_done: smbldap_set_mod(&mods, LDAP_MOD_ADD, "homeDirectory", dir); smbldap_set_mod(&mods, LDAP_MOD_ADD, "loginShell", shell); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSID", - sid_string_talloc(tc, &sid)); + dom_sid_str_buf(&sid, &sid_str)); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaAcctFlags", pdb_encode_acct_ctrl(ACB_NORMAL|ACB_DISABLED, NEW_PW_FORMAT_SPACE_PADDED_LEN)); @@ -1957,6 +1960,7 @@ doma_done: if (!pdb_getsampwnam(samuser, lp_guest_account())) { LDAPMod **mods = NULL; struct dom_sid sid; + struct dom_sid_buf sid_str; char *dn; char *uidstr; char *gidstr; @@ -2033,7 +2037,7 @@ doma_done: smbldap_set_mod(&mods, LDAP_MOD_ADD, "loginShell", pwd->pw_shell); } smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSID", - sid_string_talloc(tc, &sid)); + dom_sid_str_buf(&sid, &sid_str)); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaAcctFlags", pdb_encode_acct_ctrl(ACB_NORMAL|ACB_DISABLED, NEW_PW_FORMAT_SPACE_PADDED_LEN)); @@ -2074,6 +2078,7 @@ doma_done: } if (!pdb_getgrgid(gmap, pwd->pw_gid)) { + struct dom_sid_buf gsid_str; LDAPMod **mods = NULL; char *dn; char *uname; @@ -2109,7 +2114,7 @@ doma_done: smbldap_set_mod(&mods, LDAP_MOD_ADD, "displayName", wname); smbldap_set_mod(&mods, LDAP_MOD_ADD, "gidNumber", gidstr); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSid", - sid_string_talloc(tc, &gsid)); + dom_sid_str_buf(&gsid, &gsid_str)); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaGroupType", gtype); smbldap_talloc_autofree_ldapmod(tc, mods); |