mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-07 06:03:51 +00:00
pam_systemd: use F_DUPFD_CLOEXEC when dupping session fds
http://lists.freedesktop.org/archives/systemd-devel/2014-May/019034.html
(cherry picked from commit 85c08dc013)
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
9ceee7ebb5
commit
67eb48925c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user