Red Hat Bugzilla – Bug 1533964
sudo skips PAM account module in case NOPASSWD is used in sudoers
Last modified: 2018-10-30 07:09:47 EDT
Description of problem: sudo skips the PAM account phase and therefore also skips the pam_time module which results in failed time based account restriction. sudo should use 'pam_acct_mgmt()' in case no authentication is required. The function is fully independent of 'pam_authenticate()'. http://www.linux-pam.org/Linux-PAM-html/adg-interface-by-app-expected.html#adg-pam_acct_mgmt Version-Release number of selected component (if applicable): all versions of sudo are affected. How reproducible: /etc/sudoers: foobar ALL=(ALL) NOPASSWD: ALL /etc/pam.d/sudo: account required pam_time.so /etc/security/time.conf: sudo;*;*;!Al0000-24000 sudo still works for the 'foobar' user. Expectation is that sudo is failing. Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Created attachment 1382271 [details] proposed patch
Created attachment 1486438 [details] upstream fix of a regression related to NOPASSWD PAM stack handling
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:3199