summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-27 22:22:35 -0800
committerJeremy Allison <jra@samba.org>2007-11-27 22:22:35 -0800
commit1cd1c9db3f3350dd4585d96457e918652557855c (patch)
tree6b92d688d8590e2ade1af0720f3a51f8de560a26 /source3/passdb
parentb11e6f21589a00c1803985f202be9cd360944d43 (diff)
downloadsamba-1cd1c9db3f3350dd4585d96457e918652557855c.tar.gz
samba-1cd1c9db3f3350dd4585d96457e918652557855c.tar.bz2
samba-1cd1c9db3f3350dd4585d96457e918652557855c.zip
Remove unused prototype for smbldap_get_single_pstring().
Don't use pstr_sprintf() on an fstring - change to talloc. Jeremy. (This used to be commit 6cae4b5fa1bcb848cb2a28daaafeefd6bcd08274)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 707e3f3a30..7a3d55999e 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -3403,11 +3403,14 @@ static NTSTATUS ldapsam_setsamgrent(struct pdb_methods *my_methods,
{
struct ldapsam_privates *ldap_state =
(struct ldapsam_privates *)my_methods->private_data;
- fstring filter;
+ char *filter = NULL;
int rc;
const char **attr_list;
- pstr_sprintf( filter, "(objectclass=%s)", LDAP_OBJ_GROUPMAP);
+ filter = talloc_asprintf(NULL, "(objectclass=%s)", LDAP_OBJ_GROUPMAP);
+ if (!filter) {
+ return NT_STATUS_NO_MEMORY;
+ }
attr_list = get_attr_list( NULL, groupmap_attr_list );
rc = smbldap_search(ldap_state->smbldap_state, lp_ldap_group_suffix(),
LDAP_SCOPE_SUBTREE, filter,
@@ -3421,9 +3424,12 @@ static NTSTATUS ldapsam_setsamgrent(struct pdb_methods *my_methods,
lp_ldap_group_suffix(), filter));
ldap_msgfree(ldap_state->result);
ldap_state->result = NULL;
+ TALLOC_FREE(filter);
return NT_STATUS_UNSUCCESSFUL;
}
+ TALLOC_FREE(filter);
+
DEBUG(2, ("ldapsam_setsamgrent: %d entries in the base!\n",
ldap_count_entries(ldap_state->smbldap_state->ldap_struct,
ldap_state->result)));