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
This commit is contained in:
Tim Rice 2002-05-11 15:30:04 -07:00
parent aef7371fe4
commit 802b956868
2 changed files with 11 additions and 6 deletions

View File

@ -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 $

View File

@ -39,13 +39,14 @@ mm_send_fd(int socket, int fd)
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 @@ mm_receive_fd(int socket)
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 @@ mm_receive_fd(int socket)
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 @@ mm_receive_fd(int socket)
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