summaryrefslogtreecommitdiff
path: root/xserver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2018-08-06 20:11:35 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2018-08-06 20:11:35 +0000
commitb5c8e356a44e75a249ec39ca5203bf32a3d13799 (patch)
treedb200f2844068a808551c54e9232775aa58df5d1 /xserver
parentd2914a083917b266fec8fba2c02854fc4103bdd2 (diff)
set MSG_CMSG_CLOEXEC when receiving file descriptors.
All file descriptors opened via priv_open_device() can benefit of the close-on-exec flag. ok kettenis@.
Diffstat (limited to 'xserver')
-rw-r--r--xserver/os/privsep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xserver/os/privsep.c b/xserver/os/privsep.c
index 8d260e95d..4c38e308d 100644
--- a/xserver/os/privsep.c
+++ b/xserver/os/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.28 2015/11/11 21:07:49 matthieu Exp $ */
+/* $OpenBSD: privsep.c,v 1.29 2018/08/06 20:11:34 matthieu Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -207,7 +207,7 @@ receive_fd(int s)
msg.msg_controllen = sizeof(cmsgbuf.buf);
do
- n = recvmsg(s, &msg, 0);
+ n = recvmsg(s, &msg, MSG_CMSG_CLOEXEC);
while (n == -1 && errno == EINTR);
if (n != sizeof(int)) {