Skip to content

Commit

Permalink
security fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dtenenba committed Mar 9, 2022
1 parent e93a1a1 commit b5a95c2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/backend/api/utils/pam.py
Expand Up @@ -6,7 +6,7 @@
# for security reasons.
#
# Audited by Andrei Cioara <andrei@cioara.me> on 2019-06-14
# for integartion into Motuz.
# for integration into Motuz.

# (c) 2007 Chris AtLee <chris@atlee.ca>
# Licensed under the MIT license:
Expand Down Expand Up @@ -106,6 +106,10 @@ class PamConv(Structure):
pam_authenticate.restype = c_int
pam_authenticate.argtypes = [PamHandle, c_int]

pam_acct_mgmt = libpam.pam_acct_mgmt
pam_acct_mgmt.restype = c_int
pam_acct_mgmt.argtypes = [PamHandle, c_int]

class pam():
code = 0
reason = None
Expand Down Expand Up @@ -184,6 +188,8 @@ def my_conv(n_messages, messages, p_response, app_data):
return False

retval = pam_authenticate(handle, 0)
if retval == 0:
retval = pam_acct_mgmt(handle, 0)
auth_success = retval == 0

if auth_success and resetcreds:
Expand Down

0 comments on commit b5a95c2

Please sign in to comment.