From 105635e23c5c77c5efed727bbc686650406ab82e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 15 Dec 2007 21:10:58 +0100 Subject: Use sid_string_talloc where we have a tmp talloc ctx (This used to be commit f00ab810d2540679bec109498ac89e1eafe18f03) --- source3/passdb/pdb_ldap.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'source3/passdb/pdb_ldap.c') 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