mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Bugfix: auth PAM doesn't throw an exception when authenticating without username and password
This commit is contained in:
parent
72d40d45e5
commit
ee687bea18
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue