Skip to content

Commit fb86000

Browse files
committed
fixed pam auth skipping authorization
1 parent d3363a8 commit fb86000

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
- Booth ticket name validation ([rhbz#2053177])
1414
- Adding booth ticket doesn't report 'mode' as an uknown option anymore
1515
([rhbz#2058243])
16+
- Pcs daemon was allowing expired accounts, and accounts with expired
17+
passwords to login when using PAM auth. ([huntr#220307])
1618

1719
[rhbz#2024522]: https://bugzilla.redhat.com/show_bug.cgi?id=2024522
1820
[rhbz#2053177]: https://bugzilla.redhat.com/show_bug.cgi?id=2053177
1921
[rhbz#2054671]: https://bugzilla.redhat.com/show_bug.cgi?id=2054671
2022
[rhbz#2058243]: https://bugzilla.redhat.com/show_bug.cgi?id=2058243
23+
[huntr#220307]: https://huntr.dev/bounties/7aa921fc-a568-4fd8-96f4-7cd826246aa5/
2124

2225

2326
## [0.11.2] - 2022-02-01

pcs/daemon/auth.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def prep_fn(fn, restype, argtypes):
6464
strdup = prep_fn(libc.strdup, POINTER(c_char), [c_char_p])
6565
calloc = prep_fn(libc.calloc, c_void_p, [c_uint, c_uint])
6666
pam_authenticate = prep_fn(libpam.pam_authenticate, c_int, [pam_handle, c_int])
67+
pam_acct_mgmt = prep_fn(libpam.pam_acct_mgmt, c_int, [pam_handle, c_int])
6768
pam_end = prep_fn(libpam.pam_end, c_int, [pam_handle, c_int])
6869
pam_start = prep_fn(
6970
libpam.pam_start,
@@ -102,6 +103,8 @@ def conv(
102103
)
103104
if returncode == PAM_SUCCESS:
104105
returncode = pam_authenticate(pamh, 0)
106+
if returncode == PAM_SUCCESS:
107+
returncode = pam_acct_mgmt(pamh, 0)
105108
pam_end(pamh, returncode)
106109
return returncode == PAM_SUCCESS
107110

0 commit comments

Comments
 (0)