summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-08-18 12:57:43 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-10-08 19:51:16 -0400
commit21df9f2a3fc890db98bcaa9b93f9398d723d01dd (patch)
treec1a75d31ffce736fcdeaeb1c3428fbee7475ee18
parentee87f8d64a5d522363bfa29478501dc523cc8816 (diff)
downloadsssd-21df9f2a3fc890db98bcaa9b93f9398d723d01dd.tar.gz
sssd-21df9f2a3fc890db98bcaa9b93f9398d723d01dd.tar.xz
sssd-21df9f2a3fc890db98bcaa9b93f9398d723d01dd.zip
Treat a zero-length password as a failure
Some LDAP servers allow binding with blank passwords. We should not allow a blank password to authenticate the SSSD.
-rw-r--r--src/providers/ldap/ldap_auth.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/providers/ldap/ldap_auth.c b/src/providers/ldap/ldap_auth.c
index b05e3075c..1a959d4cc 100644
--- a/src/providers/ldap/ldap_auth.c
+++ b/src/providers/ldap/ldap_auth.c
@@ -557,6 +557,13 @@ static struct tevent_req *auth_send(TALLOC_CTX *memctx,
req = tevent_req_create(memctx, &state, struct auth_state);
if (!req) return NULL;
+ /* Treat a zero-length password as a failure */
+ if (password.length == 0) {
+ state->result = SDAP_AUTH_FAILED;
+ tevent_req_done(req);
+ return tevent_req_post(req, ev);
+ }
+
state->ev = ev;
state->ctx = ctx;
state->username = username;