浏览代码

Incorrect password allows to log into Hue when using pam_use_pwd_module with LDAP as a backend (#2629)

Jira: CDPD-31058
Mahesh Balakrishnan 4 年之前
父节点
当前提交
8f5521adc7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      desktop/core/src/desktop/auth/backend.py

+ 1 - 1
desktop/core/src/desktop/auth/backend.py

@@ -594,7 +594,7 @@ class LdapBackend(object):
       LOG.warning("LDAP was not properly configured: %s", detail)
       return None
 
-    if AUTH.PAM_USE_PWD_MODULE.get():
+    if AUTH.PAM_USE_PWD_MODULE.get() and user is not None:
       LOG.debug('Setting LDAP username to %s using PAM pwd module for user %s' % (getpwnam(username).pw_name, username))
       pam_user = getpwnam(username).pw_name
       try: