Bugfix: auth PAM doesn't throw an exception when authenticating without username and password
This commit is contained in:
parent
72d40d45e5
commit
ee687bea18
@ -36,6 +36,9 @@ GROUP_MEMBERSHIP = config.get("auth", "pam_group_membership")
|
|||||||
def is_authenticated(user, password):
|
def is_authenticated(user, password):
|
||||||
"""Check if ``user``/``password`` couple is valid."""
|
"""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
|
# Check whether the user exists in the PAM system
|
||||||
try:
|
try:
|
||||||
pwd.getpwnam(user).pw_uid
|
pwd.getpwnam(user).pw_uid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user