summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2007-09-10 19:14:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:38 -0500
commitac1642508fb2f4f8e628e3309a89624a8b2ec1bf (patch)
tree272e326cb67c6ce617afeff33fb1fc167ca9a741 /source3
parentbb9fbe62216e0ee5e9da9e91c6bc705ad1d7a5c8 (diff)
downloadsamba-ac1642508fb2f4f8e628e3309a89624a8b2ec1bf.tar.gz
samba-ac1642508fb2f4f8e628e3309a89624a8b2ec1bf.tar.bz2
samba-ac1642508fb2f4f8e628e3309a89624a8b2ec1bf.zip
r25063: Fix segfault in smbldp_set_creds when we want to use anonymous, the
code was not passing in the "anon" flag correctly and was passing NULL pointers. (This used to be commit 6316a9c14d8bc467c84c1604248a9e30abaacd2f)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/idmap_ldap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/nsswitch/idmap_ldap.c b/source3/nsswitch/idmap_ldap.c
index 7f0747068b..3e6e65727e 100644
--- a/source3/nsswitch/idmap_ldap.c
+++ b/source3/nsswitch/idmap_ldap.c
@@ -78,6 +78,7 @@ static NTSTATUS get_credentials( TALLOC_CTX *mem_ctx,
char *secret = NULL;
const char *tmp = NULL;
char *user_dn = NULL;
+ bool anon = false;
/* assume anonymous if we don't have a specified user */
@@ -106,7 +107,7 @@ static NTSTATUS get_credentials( TALLOC_CTX *mem_ctx,
if (!fetch_ldap_pw(&user_dn, &secret)) {
DEBUG(2, ("get_credentials: Failed to lookup ldap "
"bind creds. Using anonymous connection.\n"));
- *dn = talloc_strdup(mem_ctx, "");
+ anon = true;
} else {
*dn = talloc_strdup(mem_ctx, user_dn);
SAFE_FREE( user_dn );
@@ -114,10 +115,10 @@ static NTSTATUS get_credentials( TALLOC_CTX *mem_ctx,
}
}
- smbldap_set_creds(ldap_state, false, *dn, secret);
+ smbldap_set_creds(ldap_state, anon, *dn, secret);
ret = NT_STATUS_OK;
- done:
+done:
SAFE_FREE(secret);
return ret;