summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/login/pam-module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/login/pam-module.c b/src/login/pam-module.c
index 9873dd547a..1259457efc 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;