Merge pull request #11465 from rgirada/pam_coverity

vtysh: Account validity should be verified when authenticating users with PAM
This commit is contained in:
Donald Sharp 2022-06-24 07:02:38 -04:00 committed by GitHub
commit 1f97f6839a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,6 +71,10 @@ static int vtysh_pam(const char *user)
fprintf(stderr, "vtysh_pam: Failure to initialize pam: %s(%d)",
pam_strerror(pamh, ret), ret);
if (pam_acct_mgmt(pamh, 0) != PAM_SUCCESS)
fprintf(stderr, "%s: Failed in account validation: %s(%d)",
__func__, pam_strerror(pamh, ret), ret);
/* close Linux-PAM */
if (pam_end(pamh, ret) != PAM_SUCCESS) {
pamh = NULL;