diff options
author | Volker Lendecke <vl@samba.org> | 2007-12-15 21:10:58 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2007-12-15 22:09:35 +0100 |
commit | 105635e23c5c77c5efed727bbc686650406ab82e (patch) | |
tree | 694d5f9b7599dd208b74331652f59497d8716ff0 | |
parent | 2cb7f5f632fc3c30c0afa57d1c99f506885f113a (diff) | |
download | samba-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)
-rw-r--r-- | source3/auth/auth_util.c | 4 | ||||
-rw-r--r-- | source3/passdb/pdb_ldap.c | 30 | ||||
-rw-r--r-- | source3/winbindd/idmap_ldap.c | 7 |
3 files changed, 22 insertions, 19 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index c0a9e9bc84..0d4caecb2d 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -586,12 +586,12 @@ static NTSTATUS log_nt_token(TALLOC_CTX *tmp_ctx, NT_USER_TOKEN *token) for (i=1; i<token->num_sids; i++) { group_sidstr = talloc_asprintf( tmp_ctx, "%s %s", group_sidstr, - sid_string_static(&token->user_sids[i])); + sid_string_talloc(tmp_ctx, &token->user_sids[i])); } command = talloc_string_sub( tmp_ctx, lp_log_nt_token_command(), - "%s", sid_string_static(&token->user_sids[0])); + "%s", sid_string_talloc(tmp_ctx, &token->user_sids[0])); command = talloc_string_sub(tmp_ctx, command, "%t", group_sidstr); if (command == NULL) { 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); diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c index a980d54bbe..17e9eefe43 100644 --- a/source3/winbindd/idmap_ldap.c +++ b/source3/winbindd/idmap_ldap.c @@ -1166,7 +1166,7 @@ static NTSTATUS idmap_ldap_sids_to_unixids(struct idmap_domain *dom, filter = talloc_asprintf(memctx, "(&(objectClass=%s)(%s=%s))", LDAP_OBJ_IDMAP_ENTRY, LDAP_ATTRIBUTE_SID, - sid_string_static(ids[0]->sid)); + sid_string_talloc(memctx, ids[0]->sid)); CHECK_ALLOC_DONE(filter); DEBUG(10, ("Filter: [%s]\n", filter)); } else { @@ -1187,7 +1187,8 @@ again: for (i = 0; (i < IDMAP_LDAP_MAX_IDS) && ids[idx]; i++, idx++) { filter = talloc_asprintf_append_buffer(filter, "(%s=%s)", LDAP_ATTRIBUTE_SID, - sid_string_static(ids[idx]->sid)); + sid_string_talloc(memctx, + ids[idx]->sid)); CHECK_ALLOC_DONE(filter); } filter = talloc_asprintf_append_buffer(filter, "))"); @@ -1385,7 +1386,7 @@ static NTSTATUS idmap_ldap_set_mapping(struct idmap_domain *dom, id_str = talloc_asprintf(memctx, "%lu", (unsigned long)map->xid.id); CHECK_ALLOC_DONE(id_str); - sid = talloc_strdup(memctx, sid_string_static(map->sid)); + sid = talloc_strdup(memctx, sid_string_talloc(memctx, map->sid)); CHECK_ALLOC_DONE(sid); dn = talloc_asprintf(memctx, "%s=%s,%s", |