diff options
author | Damien Miller <djm@mindrot.org> | 2008-03-27 01:01:15 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2008-03-27 01:01:15 +0100 |
commit | e241e85ad3fd50fb94666ddaa52e44cbaae47fbb (patch) | |
tree | 167d412bddfe01d0c29f1d31d6dd4a671c67b4a1 /monitor_fdpass.c | |
parent | - djm@cvs.openbsd.org 2008/03/23 12:54:01 (diff) | |
download | openssh-e241e85ad3fd50fb94666ddaa52e44cbaae47fbb.tar.xz openssh-e241e85ad3fd50fb94666ddaa52e44cbaae47fbb.zip |
- deraadt@cvs.openbsd.org 2008/03/24 16:11:07
[monitor_fdpass.c]
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
Diffstat (limited to '')
-rw-r--r-- | monitor_fdpass.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/monitor_fdpass.c b/monitor_fdpass.c index 18ae6248a..cab538bc9 100644 --- a/monitor_fdpass.c +++ b/monitor_fdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor_fdpass.c,v 1.16 2008/03/15 16:19:02 deraadt Exp $ */ +/* $OpenBSD: monitor_fdpass.c,v 1.17 2008/03/24 16:11:07 deraadt Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -63,7 +63,7 @@ mm_send_fd(int sock, int fd) msg.msg_accrightslen = sizeof(fd); #else msg.msg_control = (caddr_t)&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; @@ -121,7 +121,7 @@ mm_receive_fd(int sock) msg.msg_accrightslen = sizeof(fd); #else msg.msg_control = &cmsgbuf.buf; - msg.msg_controllen = CMSG_LEN(sizeof(int)); + msg.msg_controllen = sizeof(cmsgbuf.buf); #endif if ((n = recvmsg(sock, &msg, 0)) == -1) { |