diff options
-rw-r--r-- | source3/libads/disp_sec.c | 6 | ||||
-rw-r--r-- | source3/passdb/pdb_ldap.c | 7 | ||||
-rw-r--r-- | source3/utils/net_sam.c | 15 | ||||
-rw-r--r-- | source3/winbindd/winbindd_misc.c | 47 |
4 files changed, 41 insertions, 34 deletions
diff --git a/source3/libads/disp_sec.c b/source3/libads/disp_sec.c index e211ef69e4..f4c68638df 100644 --- a/source3/libads/disp_sec.c +++ b/source3/libads/disp_sec.c @@ -163,7 +163,7 @@ static void ads_disp_ace(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, SEC_ACE *sec_ace) } printf("access SID: %s\naccess type: %s\n", - sid_string_static(&sec_ace->trustee), access_type); + sid_string_talloc(mem_ctx, &sec_ace->trustee), access_type); if (sec_ace_object(sec_ace->type)) { ads_disp_sec_ace_object(ads, mem_ctx, &sec_ace->object.object); @@ -213,9 +213,9 @@ void ads_disp_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, SEC_DESC *sd) sd->type); printf("owner SID: %s\n", sd->owner_sid ? - sid_string_static(sd->owner_sid) : "(null)"); + sid_string_talloc(mem_ctx, sd->owner_sid) : "(null)"); printf("group SID: %s\n", sd->group_sid ? - sid_string_static(sd->group_sid) : "(null)"); + sid_string_talloc(mem_ctx, sd->group_sid) : "(null)"); ads_disp_acl(sd->sacl, "system"); if (sd->sacl) { diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index bb983a6086..b6f8c2d92e 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -3084,7 +3084,7 @@ static NTSTATUS ldapsam_map_posixgroup(TALLOC_CTX *mem_ctx, smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectClass", "sambaGroupMapping"); smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, entry, &mods, "sambaSid", - sid_string_static(&map->sid)); + sid_string_talloc(mem_ctx, &map->sid)); smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, entry, &mods, "sambaGroupType", talloc_asprintf(mem_ctx, "%d", map->sid_name_use)); smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, entry, &mods, "displayName", @@ -4072,8 +4072,9 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods, for (i=0; i<num_rids; i++) { DOM_SID sid; sid_compose(&sid, domain_sid, rids[i]); - allsids = talloc_asprintf_append_buffer(allsids, "(sambaSid=%s)", - sid_string_static(&sid)); + allsids = talloc_asprintf_append_buffer( + allsids, "(sambaSid=%s)", + sid_string_talloc(mem_ctx, &sid)); if (allsids == NULL) { goto done; } diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index b7e21c6849..123aa54715 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -1324,7 +1324,8 @@ static int net_sam_provision(int argc, const char **argv) smbldap_set_mod(&mods, LDAP_MOD_ADD, "cn", uname); 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_static(&gsid)); + smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSid", + sid_string_talloc(tc, &gsid)); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaGroupType", gtype); talloc_autofree_ldapmod(tc, mods); @@ -1378,7 +1379,8 @@ domu_done: smbldap_set_mod(&mods, LDAP_MOD_ADD, "cn", uname); 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_static(&gsid)); + smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSid", + sid_string_talloc(tc, &gsid)); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaGroupType", gtype); talloc_autofree_ldapmod(tc, mods); @@ -1455,7 +1457,8 @@ doma_done: smbldap_set_mod(&mods, LDAP_MOD_ADD, "gidNumber", gidstr); 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_static(&sid)); + smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSID", + sid_string_talloc(tc, &sid)); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaAcctFlags", pdb_encode_acct_ctrl(ACB_NORMAL|ACB_DISABLED, NEW_PW_FORMAT_SPACE_PADDED_LEN)); @@ -1538,7 +1541,8 @@ doma_done: if ((pwd->pw_shell != NULL) && (pwd->pw_shell[0] != '\0')) { smbldap_set_mod(&mods, LDAP_MOD_ADD, "loginShell", pwd->pw_shell); } - smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSID", sid_string_static(&sid)); + smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSID", + sid_string_talloc(tc, &sid)); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaAcctFlags", pdb_encode_acct_ctrl(ACB_NORMAL|ACB_DISABLED, NEW_PW_FORMAT_SPACE_PADDED_LEN)); @@ -1597,7 +1601,8 @@ doma_done: smbldap_set_mod(&mods, LDAP_MOD_ADD, "cn", uname); 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_static(&gsid)); + smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaSid", + sid_string_talloc(tc, &gsid)); smbldap_set_mod(&mods, LDAP_MOD_ADD, "sambaGroupType", gtype); talloc_autofree_ldapmod(tc, mods); diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c index 9d77879e76..43ec5c6d9a 100644 --- a/source3/winbindd/winbindd_misc.c +++ b/source3/winbindd/winbindd_misc.c @@ -108,16 +108,16 @@ void winbindd_list_trusted_domains(struct winbindd_cli_state *state) for ( d=domain_list(); d; d=d->next ) { if ( !extra_data ) { - extra_data = talloc_asprintf(state->mem_ctx, "%s\\%s\\%s", - d->name, - d->alt_name ? d->alt_name : d->name, - sid_string_static(&d->sid)); + extra_data = talloc_asprintf( + state->mem_ctx, "%s\\%s\\%s", + d->name, d->alt_name ? d->alt_name : d->name, + sid_string_talloc(state->mem_ctx, &d->sid)); } else { - extra_data = talloc_asprintf(state->mem_ctx, "%s\n%s\\%s\\%s", - extra_data, - d->name, - d->alt_name ? d->alt_name : d->name, - sid_string_static(&d->sid)); + extra_data = talloc_asprintf( + state->mem_ctx, "%s\n%s\\%s\\%s", + extra_data, d->name, + d->alt_name ? d->alt_name : d->name, + sid_string_talloc(state->mem_ctx, &d->sid)); } } @@ -163,17 +163,18 @@ enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain * extra_data = talloc_strdup(state->mem_ctx, ""); if (num_domains > 0) - extra_data = talloc_asprintf(state->mem_ctx, "%s\\%s\\%s", - names[0], - alt_names[0] ? alt_names[0] : names[0], - sid_string_static(&sids[0])); + extra_data = talloc_asprintf( + state->mem_ctx, "%s\\%s\\%s", + names[0], alt_names[0] ? alt_names[0] : names[0], + sid_string_talloc(state->mem_ctx, &sids[0])); for (i=1; i<num_domains; i++) - extra_data = talloc_asprintf(state->mem_ctx, "%s\n%s\\%s\\%s", - extra_data, - names[i], - alt_names[i] ? alt_names[i] : names[i], - sid_string_static(&sids[i])); + extra_data = talloc_asprintf( + state->mem_ctx, "%s\n%s\\%s\\%s", + extra_data, names[i], + alt_names[i] ? alt_names[i] : names[i], + sid_string_talloc(state->mem_ctx, &sids[i])); + /* add our primary domain */ for (i=0; i<num_domains; i++) { @@ -184,11 +185,11 @@ enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain * } if (state->request.data.list_all_domains && !have_own_domain) { - extra_data = talloc_asprintf(state->mem_ctx, "%s\n%s\\%s\\%s", - extra_data, - domain->name, - domain->alt_name ? domain->alt_name : domain->name, - sid_string_static(&domain->sid)); + extra_data = talloc_asprintf( + state->mem_ctx, "%s\n%s\\%s\\%s", + extra_data, domain->name, + domain->alt_name ? domain->alt_name : domain->name, + sid_string_talloc(state->mem_ctx, &domain->sid)); } /* This is a bit excessive, but the extra data sooner or later will be |