diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | monitor_fdpass.c | 6 |
2 files changed, 9 insertions, 4 deletions
@@ -13,6 +13,11 @@ | |||
13 | [monitor_fdpass.c] | 13 | [monitor_fdpass.c] |
14 | Correct CMSG_SPACE and CMSG_LEN usage everywhere in the tree. Due to | 14 | Correct CMSG_SPACE and CMSG_LEN usage everywhere in the tree. Due to |
15 | an extensive discussion with otto, kettenis, millert, and hshoexer | 15 | an extensive discussion with otto, kettenis, millert, and hshoexer |
16 | - deraadt@cvs.openbsd.org 2008/03/15 16:19:02 | ||
17 | [monitor_fdpass.c] | ||
18 | Repair the simple cases for msg_controllen where it should just be | ||
19 | CMSG_SIZE(sizeof(int)), not sizeof(buffer) which may be larger because | ||
20 | of alignment; ok kettenis hshoexer | ||
16 | 21 | ||
17 | 20080315 | 22 | 20080315 |
18 | - (djm) [regress/test-exec.sh] Quote putty-related variables in case they are | 23 | - (djm) [regress/test-exec.sh] Quote putty-related variables in case they are |
@@ -3781,4 +3786,4 @@ | |||
3781 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 3786 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
3782 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 3787 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
3783 | 3788 | ||
3784 | $Id: ChangeLog,v 1.4883 2008/03/26 23:53:23 djm Exp $ | 3789 | $Id: ChangeLog,v 1.4884 2008/03/26 23:54:44 djm Exp $ |
diff --git a/monitor_fdpass.c b/monitor_fdpass.c index a3e995df8..18ae6248a 100644 --- a/monitor_fdpass.c +++ b/monitor_fdpass.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: monitor_fdpass.c,v 1.15 2008/03/13 01:49:53 deraadt Exp $ */ | 1 | /* $OpenBSD: monitor_fdpass.c,v 1.16 2008/03/15 16:19:02 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright 2001 Niels Provos <provos@citi.umich.edu> | 3 | * Copyright 2001 Niels Provos <provos@citi.umich.edu> |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -63,7 +63,7 @@ mm_send_fd(int sock, int fd) | |||
63 | msg.msg_accrightslen = sizeof(fd); | 63 | msg.msg_accrightslen = sizeof(fd); |
64 | #else | 64 | #else |
65 | msg.msg_control = (caddr_t)&cmsgbuf.buf; | 65 | msg.msg_control = (caddr_t)&cmsgbuf.buf; |
66 | msg.msg_controllen = sizeof(cmsgbuf.buf); | 66 | msg.msg_controllen = CMSG_LEN(sizeof(int)); |
67 | cmsg = CMSG_FIRSTHDR(&msg); | 67 | cmsg = CMSG_FIRSTHDR(&msg); |
68 | cmsg->cmsg_len = CMSG_LEN(sizeof(int)); | 68 | cmsg->cmsg_len = CMSG_LEN(sizeof(int)); |
69 | cmsg->cmsg_level = SOL_SOCKET; | 69 | cmsg->cmsg_level = SOL_SOCKET; |
@@ -121,7 +121,7 @@ mm_receive_fd(int sock) | |||
121 | msg.msg_accrightslen = sizeof(fd); | 121 | msg.msg_accrightslen = sizeof(fd); |
122 | #else | 122 | #else |
123 | msg.msg_control = &cmsgbuf.buf; | 123 | msg.msg_control = &cmsgbuf.buf; |
124 | msg.msg_controllen = sizeof(cmsgbuf.buf); | 124 | msg.msg_controllen = CMSG_LEN(sizeof(int)); |
125 | #endif | 125 | #endif |
126 | 126 | ||
127 | if ((n = recvmsg(sock, &msg, 0)) == -1) { | 127 | if ((n = recvmsg(sock, &msg, 0)) == -1) { |