瀏覽代碼

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

Štěpán Henek 12 年之前
父節點
當前提交
ee687bea18
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      radicale/auth/PAM.py

+ 3 - 0
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