diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2022-06-24 07:02:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-24 07:02:38 -0400 |
| commit | 1f97f6839a5735d82d0a975ed87e16f03e6c802c (patch) | |
| tree | d6cd997ec0c25f98ec391a43162fa730a238b6b6 | |
| parent | 9871bddd8f4ee2ff26a729f0387375c621fcb6f4 (diff) | |
| parent | 264a2a273fd1bf6543cef6bccf9019d09249b1a1 (diff) | |
Merge pull request #11465 from rgirada/pam_coverity
vtysh: Account validity should be verified when authenticating users with PAM
| -rw-r--r-- | vtysh/vtysh_user.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vtysh/vtysh_user.c b/vtysh/vtysh_user.c index 665e6ca90d..1ed284809e 100644 --- a/vtysh/vtysh_user.c +++ b/vtysh/vtysh_user.c @@ -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; |
