summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-15 21:10:58 +0100
committerVolker Lendecke <vl@samba.org>2007-12-15 22:09:35 +0100
commit105635e23c5c77c5efed727bbc686650406ab82e (patch)
tree694d5f9b7599dd208b74331652f59497d8716ff0 /source3/passdb
parent2cb7f5f632fc3c30c0afa57d1c99f506885f113a (diff)
downloadsamba-105635e23c5c77c5efed727bbc686650406ab82e.tar.gz
samba-105635e23c5c77c5efed727bbc686650406ab82e.tar.bz2
samba-105635e23c5c77c5efed727bbc686650406ab82e.zip
Use sid_string_talloc where we have a tmp talloc ctx
(This used to be commit f00ab810d2540679bec109498ac89e1eafe18f03)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 205ca68fe3..750b71fb1c 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -2248,7 +2248,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, struct s
"(&(%s=%s)(|(objectClass=%s)(objectClass=%s)))",
get_userattr_key2string(ldap_state->schema_ver,
LDAP_ATTR_USER_SID),
- sid_to_string(sid_string, sid),
+ sid_string_talloc(ctx, sid),
LDAP_OBJ_IDMAP_ENTRY,
LDAP_OBJ_SID_ENTRY);
if (!filter) {
@@ -2700,7 +2700,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods,
"(sambaSID=%s))",
LDAP_OBJ_POSIXGROUP,
LDAP_OBJ_GROUPMAP,
- sid_string_static(group));
+ sid_string_talloc(mem_ctx, group));
if (filter == NULL) {
ret = NT_STATUS_NO_MEMORY;
goto done;
@@ -3124,7 +3124,7 @@ static NTSTATUS ldapsam_add_group_mapping_entry(struct pdb_methods *methods,
}
filter = talloc_asprintf(mem_ctx, "(sambaSid=%s)",
- sid_string_static(&map->sid));
+ sid_string_talloc(mem_ctx, &map->sid));
if (filter == NULL) {
result = NT_STATUS_NO_MEMORY;
goto done;
@@ -3191,7 +3191,7 @@ static NTSTATUS ldapsam_add_group_mapping_entry(struct pdb_methods *methods,
* the best we can get out of LDAP. */
dn = talloc_asprintf(mem_ctx, "sambaSid=%s,%s",
- sid_string_static(&map->sid),
+ sid_string_talloc(mem_ctx, &map->sid),
lp_ldap_group_suffix());
if (dn == NULL) {
result = NT_STATUS_NO_MEMORY;
@@ -3206,7 +3206,7 @@ static NTSTATUS ldapsam_add_group_mapping_entry(struct pdb_methods *methods,
"sambaGroupMapping");
smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, NULL, &mods, "sambaSid",
- sid_string_static(&map->sid));
+ sid_string_talloc(mem_ctx, &map->sid));
smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, NULL, &mods, "sambaGroupType",
talloc_asprintf(mem_ctx, "%d", map->sid_name_use));
smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, NULL, &mods, "displayName",
@@ -3259,8 +3259,8 @@ static NTSTATUS ldapsam_update_group_mapping_entry(struct pdb_methods *methods,
"(sambaSid=%s)(gidNumber=%u)"
"(sambaGroupType=%d))",
LDAP_OBJ_GROUPMAP,
- sid_string_static(&map->sid), map->gid,
- map->sid_name_use);
+ sid_string_talloc(mem_ctx, &map->sid),
+ map->gid, map->sid_name_use);
if (filter == NULL) {
result = NT_STATUS_NO_MEMORY;
goto done;
@@ -3338,7 +3338,7 @@ static NTSTATUS ldapsam_delete_group_mapping_entry(struct pdb_methods *methods,
filter = talloc_asprintf(mem_ctx, "(&(objectClass=%s)(%s=%s))",
LDAP_OBJ_GROUPMAP, LDAP_ATTRIBUTE_SID,
- sid_string_static(&sid));
+ sid_string_talloc(mem_ctx, &sid));
if (filter == NULL) {
result = NT_STATUS_NO_MEMORY;
goto done;
@@ -3797,7 +3797,8 @@ static NTSTATUS ldapsam_alias_memberships(struct pdb_methods *methods,
for (i=0; i<num_members; i++)
filter = talloc_asprintf(mem_ctx, "%s(sambaSIDList=%s)",
filter,
- sid_string_static(&members[i]));
+ sid_string_talloc(mem_ctx,
+ &members[i]));
filter = talloc_asprintf(mem_ctx, "%s))", filter);
@@ -4927,7 +4928,7 @@ static bool ldapsam_sid_to_id(struct pdb_methods *methods,
filter = talloc_asprintf(mem_ctx,
"(&(sambaSid=%s)"
"(|(objectClass=%s)(objectClass=%s)))",
- sid_string_static(sid),
+ sid_string_talloc(mem_ctx, sid),
LDAP_OBJ_GROUPMAP, LDAP_OBJ_SAMBASAMACCOUNT);
if (filter == NULL) {
DEBUG(5, ("talloc_asprintf failed\n"));
@@ -5407,7 +5408,8 @@ static NTSTATUS ldapsam_create_dom_group(struct pdb_methods *my_methods,
sid_compose(&group_sid, get_global_sam_sid(), *rid);
- groupsidstr = talloc_strdup(tmp_ctx, sid_string_static(&group_sid));
+ groupsidstr = talloc_strdup(tmp_ctx, sid_string_talloc(tmp_ctx,
+ &group_sid));
grouptype = talloc_asprintf(tmp_ctx, "%d", SID_NAME_DOM_GRP);
if (!groupsidstr || !grouptype) {
@@ -5464,7 +5466,7 @@ static NTSTATUS ldapsam_delete_dom_group(struct pdb_methods *my_methods, TALLOC_
"(&(sambaSID=%s)"
"(objectClass=%s)"
"(objectClass=%s))",
- sid_string_static(&group_sid),
+ sid_string_talloc(tmp_ctx, &group_sid),
LDAP_OBJ_POSIXGROUP,
LDAP_OBJ_GROUPMAP);
if (filter == NULL) {
@@ -5578,7 +5580,7 @@ static NTSTATUS ldapsam_change_groupmem(struct pdb_methods *my_methods,
"(&(sambaSID=%s)"
"(objectClass=%s)"
"(objectClass=%s))",
- sid_string_static(&member_sid),
+ sid_string_talloc(tmp_ctx, &member_sid),
LDAP_OBJ_POSIXACCOUNT,
LDAP_OBJ_SAMBASAMACCOUNT);
if (filter == NULL) {
@@ -5645,7 +5647,7 @@ static NTSTATUS ldapsam_change_groupmem(struct pdb_methods *my_methods,
"(&(sambaSID=%s)"
"(objectClass=%s)"
"(objectClass=%s))",
- sid_string_static(&group_sid),
+ sid_string_talloc(tmp_ctx, &group_sid),
LDAP_OBJ_POSIXGROUP,
LDAP_OBJ_GROUPMAP);