summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-24 16:11:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-24 16:11:09 +0000
commit0bdf18c9edb2e6a9fa89a28e89d11e7b6785b1fd (patch)
treebd0dc86a525e38150bde9f0c3d55ad9dfeb4e6a2 /libexec
parent6e48c70f167662c7aec42af9bafc316e322ef92a (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
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/monitor_fdpass.c6
-rw-r--r--libexec/login_skey/login_skey.c4
-rw-r--r--libexec/login_tis/login_tis.c4
-rw-r--r--libexec/tftp-proxy/tftp-proxy.c4
-rw-r--r--libexec/tftpd/tftpd.c8
5 files changed, 13 insertions, 13 deletions
diff --git a/libexec/ftpd/monitor_fdpass.c b/libexec/ftpd/monitor_fdpass.c
index 94d116eadb6..f4923a1267a 100644
--- a/libexec/ftpd/monitor_fdpass.c
+++ b/libexec/ftpd/monitor_fdpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_fdpass.c,v 1.3 2008/03/15 16:19:02 deraadt Exp $ */
+/* $OpenBSD: monitor_fdpass.c,v 1.4 2008/03/24 16:11:00 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 = 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;
@@ -85,7 +85,7 @@ recv_fd(int sock)
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(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 a47c162b9b3..b41dac6e06f 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.21 2008/03/15 16:19:02 deraadt Exp $ */
+/* $OpenBSD: login_skey.c,v 1.22 2008/03/24 16:11:00 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 = CMSG_LEN(sizeof(int));
+ msg.msg_controllen = sizeof(cmsgbuf.buf);
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 25792b28213..ce8bc9c2a54 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.8 2008/03/15 16:19:02 deraadt Exp $ */
+/* $OpenBSD: login_tis.c,v 1.9 2008/03/24 16:11:00 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 = CMSG_LEN(sizeof(int));
+ msg.msg_controllen = sizeof(cmsgbuf.buf);
cmp = CMSG_FIRSTHDR(&msg);
cmp->cmsg_len = CMSG_LEN(sizeof(int));
diff --git a/libexec/tftp-proxy/tftp-proxy.c b/libexec/tftp-proxy/tftp-proxy.c
index af1b35dbd69..52db0d683c7 100644
--- a/libexec/tftp-proxy/tftp-proxy.c
+++ b/libexec/tftp-proxy/tftp-proxy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftp-proxy.c,v 1.4 2008/03/15 16:25:00 deraadt Exp $
+/* $OpenBSD: tftp-proxy.c,v 1.5 2008/03/24 16:11:00 deraadt Exp $
*
* Copyright (c) 2005 DLS Internet Services
* Copyright (c) 2004, 2005 Camiel Dobbelaar, <cd@sentia.nl>
@@ -164,7 +164,7 @@ main(int argc, char *argv[])
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = &cmsgbuf.buf;
- msg.msg_controllen = CMSG_LEN(sizeof(struct sockaddr_storage));
+ msg.msg_controllen = sizeof(cmsgbuf.buf);
if (recvmsg(fd, &msg, 0) < 0) {
syslog(LOG_ERR, "recvmsg: %m");
diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c
index 0fe4c9c1535..0a30406ba45 100644
--- a/libexec/tftpd/tftpd.c
+++ b/libexec/tftpd/tftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tftpd.c,v 1.61 2008/03/15 16:25:00 deraadt Exp $ */
+/* $OpenBSD: tftpd.c,v 1.62 2008/03/24 16:11:00 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -37,7 +37,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)tftpd.c 5.13 (Berkeley) 2/26/91";*/
-static char rcsid[] = "$OpenBSD: tftpd.c,v 1.61 2008/03/15 16:25:00 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tftpd.c,v 1.62 2008/03/24 16:11:00 deraadt Exp $";
#endif /* not lint */
/*
@@ -286,7 +286,7 @@ main(int argc, char *argv[])
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = &cmsgbuf.buf;
- msg.msg_controllen = CMSG_LEN(sizeof(struct sockaddr_storage));
+ msg.msg_controllen = sizeof(cmsgbuf.buf);
n = recvmsg(fd, &msg, 0);
if (n < 0) {
@@ -330,7 +330,7 @@ main(int argc, char *argv[])
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = &cmsgbuf.buf;
- msg.msg_controllen = CMSG_LEN(sizeof(struct sockaddr_storage));
+ msg.msg_controllen = sizeof(cmsgbuf.buf);
i = recvmsg(fd, &msg, 0);
if (i > 0)