diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-03-24 21:24:53 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-03-24 21:24:53 +0000 |
commit | 4f57288e329474ef350d2b50b85601148ddbb03f (patch) | |
tree | 5ef0a8e9b276fcbcdbb674b23684f831aea884a9 /app/xconsole | |
parent | 35a255c4cd77538646b7acda1b1d6060e39f03d5 (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 'app/xconsole')
-rw-r--r-- | app/xconsole/privsep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/xconsole/privsep.c b/app/xconsole/privsep.c index a111833e1..1bcd06510 100644 --- a/app/xconsole/privsep.c +++ b/app/xconsole/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.3 2008/03/15 17:14:11 matthieu Exp $ */ +/* $OpenBSD: privsep.c,v 1.4 2008/03/24 21:24:52 matthieu Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -76,7 +76,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; @@ -118,7 +118,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__); |