diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-03-15 16:19:03 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-03-15 16:19:03 +0000 |
commit | 4e21997d99bba966cb7bcf94c8c986448d4b6d75 (patch) | |
tree | f3d05dfdca189fb3e47b22d7c23255188cb44ab7 /libexec | |
parent | bb6875f015e972c353dac4616e93affe94d56162 (diff) |
Repair the simple cases for msg_controllen where it should just be
CMSG_SIZE(sizeof(int)), not sizeof(buffer) which may be larger because
of alignment; ok kettenis hshoexer
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ftpd/monitor_fdpass.c | 6 | ||||
-rw-r--r-- | libexec/login_skey/login_skey.c | 4 | ||||
-rw-r--r-- | libexec/login_tis/login_tis.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/libexec/ftpd/monitor_fdpass.c b/libexec/ftpd/monitor_fdpass.c index cc3d33d380d..94d116eadb6 100644 --- a/libexec/ftpd/monitor_fdpass.c +++ b/libexec/ftpd/monitor_fdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor_fdpass.c,v 1.2 2008/03/13 01:49:52 deraadt Exp $ */ +/* $OpenBSD: monitor_fdpass.c,v 1.3 2008/03/15 16:19:02 deraadt Exp $ */ /* * Copyright (c) 2002 Matthieu Herrb @@ -44,7 +44,7 @@ send_fd(int sock, int fd) if (fd >= 0) { msg.msg_control = (caddr_t)&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; @@ -85,7 +85,7 @@ recv_fd(int sock) 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(sock, &msg, 0)) == -1) syslog(LOG_WARNING, "recv_fd: recvmsg(%d): %m", sock); diff --git a/libexec/login_skey/login_skey.c b/libexec/login_skey/login_skey.c index 9a036c72e88..a47c162b9b3 100644 --- a/libexec/login_skey/login_skey.c +++ b/libexec/login_skey/login_skey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login_skey.c,v 1.20 2008/03/13 01:49:52 deraadt Exp $ */ +/* $OpenBSD: login_skey.c,v 1.21 2008/03/15 16:19:02 deraadt Exp $ */ /* * Copyright (c) 2000, 2001, 2004 Todd C. Miller <Todd.Miller@courtesan.com> @@ -270,7 +270,7 @@ send_fd(int sock) memset(&msg, 0, sizeof(msg)); msg.msg_control = &cmsgbuf.buf; - msg.msg_controllen = sizeof(cmsgbuf.buf); + msg.msg_controllen = CMSG_LEN(sizeof(int)); cmp = CMSG_FIRSTHDR(&msg); cmp->cmsg_len = CMSG_LEN(sizeof(int)); diff --git a/libexec/login_tis/login_tis.c b/libexec/login_tis/login_tis.c index ca436dd5897..25792b28213 100644 --- a/libexec/login_tis/login_tis.c +++ b/libexec/login_tis/login_tis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login_tis.c,v 1.7 2008/03/13 01:49:52 deraadt Exp $ */ +/* $OpenBSD: login_tis.c,v 1.8 2008/03/15 16:19:02 deraadt Exp $ */ /* * Copyright (c) 2004 Todd C. Miller <Todd.Miller@courtesan.com> @@ -296,7 +296,7 @@ send_fd(struct tis_connection *tc, int sock) memset(&msg, 0, sizeof(msg)); msg.msg_control = &cmsgbuf.buf; - msg.msg_controllen = sizeof(cmsgbuf.buf); + msg.msg_controllen = CMSG_LEN(sizeof(int)); cmp = CMSG_FIRSTHDR(&msg); cmp->cmsg_len = CMSG_LEN(sizeof(int)); |