From: Dariusz Gadomski Date: Wed, 8 Jan 2020 15:24:11 +0000 (+0100) Subject: execute: Restore call to pam_setcred X-Git-Tag: v245-rc1~139^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3bb39ea936a51a6a63a8b65a135521df098c32c4;p=thirdparty%2Fsystemd.git execute: Restore call to pam_setcred --- diff --git a/src/core/execute.c b/src/core/execute.c index 11372958a6a..51b9a454bc8 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1193,6 +1193,10 @@ static int setup_pam( if (pam_code != PAM_SUCCESS) goto fail; + pam_code = pam_setcred(handle, PAM_ESTABLISH_CRED | flags); + if (pam_code != PAM_SUCCESS) + goto fail; + pam_code = pam_open_session(handle, flags); if (pam_code != PAM_SUCCESS) goto fail; @@ -1277,6 +1281,10 @@ static int setup_pam( } } + pam_code = pam_setcred(handle, PAM_DELETE_CRED | flags); + if (pam_code != PAM_SUCCESS) + goto child_finish; + /* If our parent died we'll end the session */ if (getppid() != parent_pid) { pam_code = pam_close_session(handle, flags);