Bugfix: auth PAM doesn't throw an exception when authenticating without username and password

This commit is contained in:
Štěpán Henek 2013-09-27 20:44:41 +02:00
parent 72d40d45e5
commit ee687bea18

View File

@ -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