diff options
| author | Yan Ka Chiu <nyan@myuji.xyz> | 2022-05-22 16:33:02 +0000 |
|---|---|---|
| committer | Ka Ho Ng <khng@FreeBSD.org> | 2022-05-22 16:36:48 +0000 |
| commit | b75e0eed345d2ab047a6b1b00a9a7c3bf92e992c (patch) | |
| tree | 4b18cb366a7c84ced083520893d4014303e49990 /lib/libpam | |
| parent | 298663855015c1eba7ccf5b88168f433653eb609 (diff) | |
Diffstat (limited to 'lib/libpam')
| -rw-r--r-- | lib/libpam/modules/pam_exec/pam_exec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libpam/modules/pam_exec/pam_exec.c b/lib/libpam/modules/pam_exec/pam_exec.c index b8f2e1d8fdfc..ef2680d80525 100644 --- a/lib/libpam/modules/pam_exec/pam_exec.c +++ b/lib/libpam/modules/pam_exec/pam_exec.c @@ -261,6 +261,13 @@ _pam_exec(pam_handle_t *pamh, /* don't prompt, only expose existing token */ rc = pam_get_item(pamh, PAM_AUTHTOK, &item); authtok = item; + if (authtok == NULL && rc == PAM_SUCCESS) { + openpam_log(PAM_LOG_ERROR, + "%s: pam_get_authtok(): %s", + func, "authentication token not available"); + OUT(PAM_SYSTEM_ERR); + } + } else { rc = pam_get_authtok(pamh, PAM_AUTHTOK, &authtok, NULL); } |
