From ee687bea188c64ece92f3df68f9b8608db498657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Henek?= Date: Fri, 27 Sep 2013 20:44:41 +0200 Subject: [PATCH] Bugfix: auth PAM doesn't throw an exception when authenticating without username and password --- radicale/auth/PAM.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radicale/auth/PAM.py b/radicale/auth/PAM.py index 1660af1..565fa6c 100644 --- a/radicale/auth/PAM.py +++ b/radicale/auth/PAM.py @@ -36,6 +36,9 @@ GROUP_MEMBERSHIP = config.get("auth", "pam_group_membership") def is_authenticated(user, password): """Check if ``user``/``password`` couple is valid.""" + if user is None or password is None: + return False + # Check whether the user exists in the PAM system try: pwd.getpwnam(user).pw_uid