summaryrefslogtreecommitdiff
path: root/src/login/pam-module.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-05-13 16:35:34 +0200
committerLennart Poettering <lennart@poettering.net>2014-05-13 16:35:34 +0200
commit85c08dc013f9f99b58bc9b79284af0b35304237b (patch)
tree16be5b37190756cf3dd5152e75dd5266074c2313 /src/login/pam-module.c
parent1514d70819246df8d1cd1388216ef91d8276fd52 (diff)
pam_systemd: use F_DUPFD_CLOEXEC when dupping session fds
http://lists.freedesktop.org/archives/systemd-devel/2014-May/019034.html
Diffstat (limited to 'src/login/pam-module.c')
-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;