summaryrefslogtreecommitdiffstats
path: root/source/nsswitch/idmap_ldap.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2007-05-03 12:28:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:52 -0500
commit565d7d0b18f18ba11f186667df95bc608a179efa (patch)
tree2cfd60203dc84f19b0aa949b187224138f27afc6 /source/nsswitch/idmap_ldap.c
parent65a2701f36439db37e8cd6067be69e8ffdc4615b (diff)
downloadsamba-565d7d0b18f18ba11f186667df95bc608a179efa.tar.gz
samba-565d7d0b18f18ba11f186667df95bc608a179efa.tar.xz
samba-565d7d0b18f18ba11f186667df95bc608a179efa.zip
r22646: segfault fix in idmap_ldap.c from 3_0_25
Diffstat (limited to 'source/nsswitch/idmap_ldap.c')
-rw-r--r--source/nsswitch/idmap_ldap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/nsswitch/idmap_ldap.c b/source/nsswitch/idmap_ldap.c
index 2fb9a17d3f5..45d2b344afa 100644
--- a/source/nsswitch/idmap_ldap.c
+++ b/source/nsswitch/idmap_ldap.c
@@ -80,11 +80,17 @@ static NTSTATUS get_credentials( TALLOC_CTX *mem_ctx,
tmp = lp_parm_const_string(-1, config_option, "ldap_user_dn", NULL);
if ( tmp ) {
- secret = idmap_fetch_secret("ldap", false, dom->name, tmp);
+ if (!dom) {
+ /* only the alloc backend is allowed to pass in a NULL dom */
+ secret = idmap_fetch_secret("ldap", true, NULL, tmp);
+ } else {
+ secret = idmap_fetch_secret("ldap", false, dom->name, tmp);
+ }
+
if (!secret) {
DEBUG(0, ("get_credentials: Unable to fetch "
"auth credentials for %s in %s\n",
- tmp, dom->name));
+ tmp, (dom==NULL)?"ALLOC":dom->name));
ret = NT_STATUS_ACCESS_DENIED;
goto done;
}