fix for systems that have both HAVE_ACCRIGHTS_IN_MSGHDR and
HAVE_CONTROL_IN_MSGHDR. Ie. sys/socket.h has #define msg_accrights msg_control
diff --git a/ChangeLog b/ChangeLog
index c8dbc70..b617a79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
- (tim) [configure.ac] applied a rework of djm's OpenSSL search cleanup patch.
Now only searches system and /usr/local/ssl (OpenSSL's default install path)
Others must use --with-ssl-dir=....
+ - (tim) [monitor_fdpass.c] fix for systems that have both
+ HAVE_ACCRIGHTS_IN_MSGHDR and HAVE_CONTROL_IN_MSGHDR. Ie. sys/socket.h has
+ #define msg_accrights msg_control
20020510
- (stevesk) [auth.c] Shadow account and expiration cleanup. Now
@@ -564,4 +567,4 @@
- (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@
-$Id: ChangeLog,v 1.2105 2002/05/11 20:17:42 tim Exp $
+$Id: ChangeLog,v 1.2106 2002/05/11 22:30:04 tim Exp $
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index 5401ea4..fb97171 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -39,13 +39,14 @@
struct iovec vec;
char ch = '\0';
int n;
-#ifndef HAVE_ACCRIGHTS_IN_MSGHDR
+#if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \
+ (defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR))
char tmp[CMSG_SPACE(sizeof(int))];
struct cmsghdr *cmsg;
#endif
memset(&msg, 0, sizeof(msg));
-#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
+#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR)
msg.msg_accrights = (caddr_t)&fd;
msg.msg_accrightslen = sizeof(fd);
#else
@@ -83,7 +84,8 @@
struct iovec vec;
char ch;
int fd, n;
-#ifndef HAVE_ACCRIGHTS_IN_MSGHDR
+#if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \
+ (defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR))
char tmp[CMSG_SPACE(sizeof(int))];
struct cmsghdr *cmsg;
#endif
@@ -93,7 +95,7 @@
vec.iov_len = 1;
msg.msg_iov = &vec;
msg.msg_iovlen = 1;
-#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
+#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR)
msg.msg_accrights = (caddr_t)&fd;
msg.msg_accrightslen = sizeof(fd);
#else
@@ -107,7 +109,7 @@
fatal("%s: recvmsg: expected received 1 got %d",
__FUNCTION__, n);
-#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
+#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR)
if (msg.msg_accrightslen != sizeof(fd))
fatal("%s: no fd", __FUNCTION__);
#else