[systemd-commits] src/login

Lennart Poettering lennart at kemper.freedesktop.org
Tue May 13 07:37:13 PDT 2014


 src/login/pam-module.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 85c08dc013f9f99b58bc9b79284af0b35304237b
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue May 13 16:35:34 2014 +0200

    pam_systemd: use F_DUPFD_CLOEXEC when dupping session fds
    
    http://lists.freedesktop.org/archives/systemd-devel/2014-May/019034.html

diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 9873dd5..1259457 100644
--- a/src/login/pam-module.c
+++ b/src/login/pam-module.c
@@ -475,7 +475,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
         }
 
         if (session_fd >= 0) {
-                session_fd = dup(session_fd);
+                session_fd = fcntl(session_fd, F_DUPFD_CLOEXEC, 3);
                 if (session_fd < 0) {
                         pam_syslog(handle, LOG_ERR, "Failed to dup session fd: %m");
                         return PAM_SESSION_ERR;



More information about the systemd-commits mailing list