mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-29 13:28:10 +00:00
Now that pam_open_session() failure is fatal we should print and log
an error from it. Bug #744
This commit is contained in:
parent
d3622b0f2c
commit
b0be9895d9
@ -303,10 +303,11 @@ sudo_pam_begin_session(struct passwd *pw, char **user_envp[], sudo_auth *auth)
|
|||||||
*pam_status = pam_open_session(pamh, 0);
|
*pam_status = pam_open_session(pamh, 0);
|
||||||
if (*pam_status != PAM_SUCCESS) {
|
if (*pam_status != PAM_SUCCESS) {
|
||||||
const char *errstr = pam_strerror(pamh, *pam_status);
|
const char *errstr = pam_strerror(pamh, *pam_status);
|
||||||
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
|
log_warningx(0, N_("pam_open_session: %s"),
|
||||||
"pam_open_session: %s", errstr ? errstr : "unknown error");
|
errstr ? errstr : "unknown error");
|
||||||
rc = pam_end(pamh, *pam_status | PAM_DATA_SILENT);
|
rc = pam_end(pamh, *pam_status | PAM_DATA_SILENT);
|
||||||
if (rc != PAM_SUCCESS) {
|
if (rc != PAM_SUCCESS) {
|
||||||
|
errstr = pam_strerror(pamh, rc);
|
||||||
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
|
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
|
||||||
"pam_end: %s", errstr ? errstr : "unknown error");
|
"pam_end: %s", errstr ? errstr : "unknown error");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user