summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-15 21:49:15 +0100
committerVolker Lendecke <vl@samba.org>2007-12-15 22:09:36 +0100
commit54ae9dfcbce727ae3107f21eee68762502acda60 (patch)
tree32a9f58abc4e3050e0a66717b6cab1223b2eabf9
parent900288a2b86abd247f9eb4cd15dc5617a17cfef1 (diff)
downloadsamba-54ae9dfcbce727ae3107f21eee68762502acda60.tar.gz
samba-54ae9dfcbce727ae3107f21eee68762502acda60.tar.bz2
samba-54ae9dfcbce727ae3107f21eee68762502acda60.zip
Use sid_string_talloc where we have a tmp talloc ctx
(This used to be commit 0a911d38b8f4be382a9df60f9c6de0c500464b3a)
-rw-r--r--source3/libads/disp_sec.c6
-rw-r--r--source3/passdb/pdb_ldap.c7
-rw-r--r--source3/utils/net_sam.c15
-rw-r--r--source3/winbindd/winbindd_misc.c47
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