Commit c14ebfcc authored by Daniele Venzano's avatar Daniele Venzano

Fix pylint error

parent 67a13c81
......@@ -57,22 +57,5 @@ class BaseAuthenticator:
def pam_authenticate(username, password):
"""Use the PAM module to authenticate. Zoe needs access to /etc/shadow."""
p = pam.pam()
return p.authenticate(username, password)
# def pam_authenticate(username, password):
# """Use su for testing credentials. Using directly the PAM library would be easier, but would also require Zoe to run as root."""
#
# try:
# child = pexpect.spawn('/bin/su', ['-', username])
# child.expect('Password:')
# child.sendline(password)
# result = child.expect(['su: Authentication failure', username])
# child.close()
# except pexpect.TIMEOUT as err:
# log.error("Error authenticating. Reason: {}".format(err))
# return False
# if result == 0:
# return False
# else:
# return True
pam_obj = pam.pam()
return pam_obj.authenticate(username, password)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment