summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-12-19 23:29:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:32 -0500
commit631a7c5cdd558ea1e1d62d46d1e9475361bb1a1f (patch)
tree5a21d6101625f3445d89d051c751e5453406713d /source4
parente17e21172affabedc807e0c22871b6e3a1072377 (diff)
downloadsamba-631a7c5cdd558ea1e1d62d46d1e9475361bb1a1f.tar.gz
samba-631a7c5cdd558ea1e1d62d46d1e9475361bb1a1f.tar.bz2
samba-631a7c5cdd558ea1e1d62d46d1e9475361bb1a1f.zip
r12381: Try not to segfault on an anonymous LDAP bind, and map to a guest login.
Andrew Bartlett (This used to be commit 5ac4178e36fade330fccb2dbb0607f524fe1f6ae)
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/cracknames.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index 977f992c08..2ea93acc32 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -692,7 +692,7 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_
const struct dom_sid *sid = samdb_result_dom_sid(mem_ctx, result_res[0], "objectSid");
const char *_acc = "", *_dom = "";
- if ((sid->num_auths < 4) || (sid->num_auths > 5)) {
+ if (!sid || (sid->num_auths < 4) || (sid->num_auths > 5)) {
info1->status = DRSUAPI_DS_NAME_STATUS_NO_MAPPING;
return WERR_OK;
}
@@ -905,7 +905,13 @@ NTSTATUS crack_dn_to_nt4_name(TALLOC_CTX *mem_ctx,
struct drsuapi_DsNameInfo1 info1;
struct ldb_context *ldb;
char *p;
-
+
+ /* Handle anonymous bind */
+ if (!dn || !*dn) {
+ *nt4_domain = "";
+ *nt4_account = "";
+ }
+
ldb = samdb_connect(mem_ctx, system_session(mem_ctx));
if (ldb == NULL) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;