diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | configure.ac | 25 | ||||
-rw-r--r-- | monitor_fdpass.c | 12 |
3 files changed, 32 insertions, 13 deletions
@@ -1,3 +1,9 @@ | |||
1 | 20020527 | ||
2 | - (tim) [configure.ac.orig monitor_fdpass.c] Enahnce msghdr tests to address | ||
3 | build problem on Irix reported by Dave Love <d.love@dl.ac.uk>. Back out | ||
4 | last monitor_fdpass.c changes that are no longer needed with new tests. | ||
5 | Patch tested on Irix by Jan-Frode Myklebust <janfrode@parallab.uib.no> | ||
6 | |||
1 | 20020522 | 7 | 20020522 |
2 | - (djm) Fix spelling mistakes, spotted by Solar Designer i | 8 | - (djm) Fix spelling mistakes, spotted by Solar Designer i |
3 | <solar@openwall.com> | 9 | <solar@openwall.com> |
@@ -671,4 +677,4 @@ | |||
671 | - (stevesk) entropy.c: typo in debug message | 677 | - (stevesk) entropy.c: typo in debug message |
672 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ | 678 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ |
673 | 679 | ||
674 | $Id: ChangeLog,v 1.2141 2002/05/22 04:24:01 djm Exp $ | 680 | $Id: ChangeLog,v 1.2142 2002/05/28 00:37:32 tim Exp $ |
diff --git a/configure.ac b/configure.ac index df78b789d..628adb392 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.63 2002/05/22 01:02:15 djm Exp $ | 1 | # $Id: configure.ac,v 1.64 2002/05/28 00:37:33 tim Exp $ |
2 | 2 | ||
3 | AC_INIT | 3 | AC_INIT |
4 | AC_CONFIG_SRCDIR([ssh.c]) | 4 | AC_CONFIG_SRCDIR([ssh.c]) |
@@ -1499,15 +1499,23 @@ if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then | |||
1499 | AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD) | 1499 | AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD) |
1500 | fi | 1500 | fi |
1501 | 1501 | ||
1502 | dnl make sure we're using the real structure members and not defines | ||
1502 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], | 1503 | AC_CACHE_CHECK([for msg_accrights field in struct msghdr], |
1503 | ac_cv_have_accrights_in_msghdr, [ | 1504 | ac_cv_have_accrights_in_msghdr, [ |
1504 | AC_TRY_COMPILE( | 1505 | AC_TRY_RUN( |
1505 | [ | 1506 | [ |
1506 | #include <sys/types.h> | 1507 | #include <sys/types.h> |
1507 | #include <sys/socket.h> | 1508 | #include <sys/socket.h> |
1508 | #include <sys/uio.h> | 1509 | #include <sys/uio.h> |
1510 | int main() { | ||
1511 | #ifdef msg_accrights | ||
1512 | exit(1); | ||
1513 | #endif | ||
1514 | struct msghdr m; | ||
1515 | m.msg_accrights = 0; | ||
1516 | exit(0); | ||
1517 | } | ||
1509 | ], | 1518 | ], |
1510 | [ struct msghdr m; m.msg_accrights = 0; ], | ||
1511 | [ ac_cv_have_accrights_in_msghdr="yes" ], | 1519 | [ ac_cv_have_accrights_in_msghdr="yes" ], |
1512 | [ ac_cv_have_accrights_in_msghdr="no" ] | 1520 | [ ac_cv_have_accrights_in_msghdr="no" ] |
1513 | ) | 1521 | ) |
@@ -1518,13 +1526,20 @@ fi | |||
1518 | 1526 | ||
1519 | AC_CACHE_CHECK([for msg_control field in struct msghdr], | 1527 | AC_CACHE_CHECK([for msg_control field in struct msghdr], |
1520 | ac_cv_have_control_in_msghdr, [ | 1528 | ac_cv_have_control_in_msghdr, [ |
1521 | AC_TRY_COMPILE( | 1529 | AC_TRY_RUN( |
1522 | [ | 1530 | [ |
1523 | #include <sys/types.h> | 1531 | #include <sys/types.h> |
1524 | #include <sys/socket.h> | 1532 | #include <sys/socket.h> |
1525 | #include <sys/uio.h> | 1533 | #include <sys/uio.h> |
1534 | int main() { | ||
1535 | #ifdef msg_control | ||
1536 | exit(1); | ||
1537 | #endif | ||
1538 | struct msghdr m; | ||
1539 | m.msg_control = 0; | ||
1540 | exit(0); | ||
1541 | } | ||
1526 | ], | 1542 | ], |
1527 | [ struct msghdr m; m.msg_control = 0; ], | ||
1528 | [ ac_cv_have_control_in_msghdr="yes" ], | 1543 | [ ac_cv_have_control_in_msghdr="yes" ], |
1529 | [ ac_cv_have_control_in_msghdr="no" ] | 1544 | [ ac_cv_have_control_in_msghdr="no" ] |
1530 | ) | 1545 | ) |
diff --git a/monitor_fdpass.c b/monitor_fdpass.c index fb97171ff..5401ea466 100644 --- a/monitor_fdpass.c +++ b/monitor_fdpass.c | |||
@@ -39,14 +39,13 @@ mm_send_fd(int socket, int fd) | |||
39 | struct iovec vec; | 39 | struct iovec vec; |
40 | char ch = '\0'; | 40 | char ch = '\0'; |
41 | int n; | 41 | int n; |
42 | #if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \ | 42 | #ifndef HAVE_ACCRIGHTS_IN_MSGHDR |
43 | (defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR)) | ||
44 | char tmp[CMSG_SPACE(sizeof(int))]; | 43 | char tmp[CMSG_SPACE(sizeof(int))]; |
45 | struct cmsghdr *cmsg; | 44 | struct cmsghdr *cmsg; |
46 | #endif | 45 | #endif |
47 | 46 | ||
48 | memset(&msg, 0, sizeof(msg)); | 47 | memset(&msg, 0, sizeof(msg)); |
49 | #if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR) | 48 | #ifdef HAVE_ACCRIGHTS_IN_MSGHDR |
50 | msg.msg_accrights = (caddr_t)&fd; | 49 | msg.msg_accrights = (caddr_t)&fd; |
51 | msg.msg_accrightslen = sizeof(fd); | 50 | msg.msg_accrightslen = sizeof(fd); |
52 | #else | 51 | #else |
@@ -84,8 +83,7 @@ mm_receive_fd(int socket) | |||
84 | struct iovec vec; | 83 | struct iovec vec; |
85 | char ch; | 84 | char ch; |
86 | int fd, n; | 85 | int fd, n; |
87 | #if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \ | 86 | #ifndef HAVE_ACCRIGHTS_IN_MSGHDR |
88 | (defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR)) | ||
89 | char tmp[CMSG_SPACE(sizeof(int))]; | 87 | char tmp[CMSG_SPACE(sizeof(int))]; |
90 | struct cmsghdr *cmsg; | 88 | struct cmsghdr *cmsg; |
91 | #endif | 89 | #endif |
@@ -95,7 +93,7 @@ mm_receive_fd(int socket) | |||
95 | vec.iov_len = 1; | 93 | vec.iov_len = 1; |
96 | msg.msg_iov = &vec; | 94 | msg.msg_iov = &vec; |
97 | msg.msg_iovlen = 1; | 95 | msg.msg_iovlen = 1; |
98 | #if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR) | 96 | #ifdef HAVE_ACCRIGHTS_IN_MSGHDR |
99 | msg.msg_accrights = (caddr_t)&fd; | 97 | msg.msg_accrights = (caddr_t)&fd; |
100 | msg.msg_accrightslen = sizeof(fd); | 98 | msg.msg_accrightslen = sizeof(fd); |
101 | #else | 99 | #else |
@@ -109,7 +107,7 @@ mm_receive_fd(int socket) | |||
109 | fatal("%s: recvmsg: expected received 1 got %d", | 107 | fatal("%s: recvmsg: expected received 1 got %d", |
110 | __FUNCTION__, n); | 108 | __FUNCTION__, n); |
111 | 109 | ||
112 | #if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR) | 110 | #ifdef HAVE_ACCRIGHTS_IN_MSGHDR |
113 | if (msg.msg_accrightslen != sizeof(fd)) | 111 | if (msg.msg_accrightslen != sizeof(fd)) |
114 | fatal("%s: no fd", __FUNCTION__); | 112 | fatal("%s: no fd", __FUNCTION__); |
115 | #else | 113 | #else |