diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-03-15 17:14:12 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-03-15 17:14:12 +0000 |
commit | d1f2ac5c7cee6d02e54c8fa055be79991def0a53 (patch) | |
tree | 8a93fae0d77e08a1a6ee4d8be095a991bb558b37 /app/xconsole | |
parent | 518ec132c62a4d051f154df842f24320ef2367f0 (diff) |
Repair msg_controllen. In those cases it should just be
CMSG_SIZE(sizeof(int)), not sizeof(buffer) which may be larger because
of alignment. Based on fixes in base system.
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 565b9fbbe..a111833e1 100644 --- a/app/xconsole/privsep.c +++ b/app/xconsole/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.2 2008/03/13 06:53:06 matthieu Exp $ */ +/* $OpenBSD: privsep.c,v 1.3 2008/03/15 17:14:11 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 = sizeof(cmsgbuf.buf); + msg.msg_controllen = CMSG_LEN(sizeof(int)); 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 = sizeof(cmsgbuf.buf); + msg.msg_controllen = CMSG_LEN(sizeof(int)); if ((n = recvmsg(socket, &msg, 0)) == -1) warn("%s: recvmsg", __func__); |