summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-08-18 12:57:43 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-08-24 12:44:56 -0400
commit2448114d633cd144482fb8e1bcf14c82a5ec7eb8 (patch)
treefebc52b88a34625d0d097c75b96ba9e1a5e4b8dd
parent68654fd974734c4ec7efb3657b6d61a3fe255515 (diff)
downloadsssd2-2448114d633cd144482fb8e1bcf14c82a5ec7eb8.tar.gz
sssd2-2448114d633cd144482fb8e1bcf14c82a5ec7eb8.tar.xz
sssd2-2448114d633cd144482fb8e1bcf14c82a5ec7eb8.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 52287030..86a979ac 100644
--- a/src/providers/ldap/ldap_auth.c
+++ b/src/providers/ldap/ldap_auth.c
@@ -459,6 +459,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;