summaryrefslogtreecommitdiff
path: root/xserver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-03-24 21:24:53 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-03-24 21:24:53 +0000
commit4f57288e329474ef350d2b50b85601148ddbb03f (patch)
tree5ef0a8e9b276fcbcdbb674b23684f831aea884a9 /xserver
parent35a255c4cd77538646b7acda1b1d6060e39f03d5 (diff)
msg_controllen has to be CMSG_SPACE so that the kernel can account for
each cmsg_len (ie. msg_controllen = sum of CMSG_ALIGN(cmsg_len). This works now that kernel fd passing has been fixed to accept a bit of sloppiness because of this ABI repair. lots of discussion with kettenis. From deraadt@
Diffstat (limited to 'xserver')
-rw-r--r--xserver/os/privsep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xserver/os/privsep.c b/xserver/os/privsep.c
index b06d937c7..507d54293 100644
--- a/xserver/os/privsep.c
+++ b/xserver/os/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.4 2008/03/15 17:14:11 matthieu Exp $ */
+/* $OpenBSD: privsep.c,v 1.5 2008/03/24 21:24:52 matthieu Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -148,7 +148,7 @@ send_fd(int socket, int fd)
if (fd >= 0) {
msg.msg_control = &cmsgbuf.buf;
- msg.msg_controllen = CMSG_LEN(sizeof(int));
+ msg.msg_controllen = sizeof(cmsgbuf.buf);
cmsg = CMSG_FIRSTHDR(&msg);
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
cmsg->cmsg_level = SOL_SOCKET;
@@ -190,7 +190,7 @@ receive_fd(int socket)
msg.msg_iov = &vec;
msg.msg_iovlen = 1;
msg.msg_control = &cmsgbuf.buf;
- msg.msg_controllen = CMSG_LEN(sizeof(int));
+ msg.msg_controllen = sizeof(cmsgbuf.buf);
if ((n = recvmsg(socket, &msg, 0)) == -1)
warn("%s: recvmsg", __func__);