]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
execute: Restore call to pam_setcred
authorDariusz Gadomski <dgadomski@gmail.com>
Wed, 8 Jan 2020 15:24:11 +0000 (16:24 +0100)
committerDariusz Gadomski <dgadomski@gmail.com>
Mon, 13 Jan 2020 09:29:20 +0000 (10:29 +0100)
src/core/execute.c

index 11372958a6ad2a28826718fa99b3e8847b367cf1..51b9a454bc8dc57af62b0d188e5bc3398cc50a79 100644 (file)
@@ -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);