3.2.2p1 build problem on Irix6.5

Tim Rice tim at multitalents.net
Sat May 25 02:20:46 EST 2002


On Tue, 21 May 2002, Jan-Frode Myklebust wrote:

> On Mon, May 20, 2002 at 04:00:21PM -0700, Tim Rice wrote:
> >
> > What is the output of grep _MSG config.h
> >
>
> I see the same problem on IRIX 6.5.15m, and the grep returns:
>
> % grep _MSG config.h
> #define HAVE_ACCRIGHTS_IN_MSGHDR 1
> #define HAVE_CONTROL_IN_MSGHDR 1
> %

Please test the attached patch.
You'll need to run autoconf and remove config.status before running configure.

If you don't have autoconf 2.52, grab configure from
http://www.multitalents.net/openssh/configure-msghdr-fix.gz
ftp://ftp.multitalents.net/pub/openssh/configure-msghdr-fix.gz

-- 
Tim Rice				Multitalents	(707) 887-1469
tim at multitalents.net

-------------- next part --------------
--- openssh/configure.ac.old	Tue May 21 21:27:46 2002
+++ openssh/configure.ac	Thu May 23 21:11:57 2002
@@ -1499,15 +1499,23 @@
 	AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
 fi
 
+dnl make sure we're using the real structure members and not defines
 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
 		ac_cv_have_accrights_in_msghdr, [
-	AC_TRY_COMPILE(
+	AC_TRY_RUN(
 		[
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
+int main() {
+#ifdef msg_accrights
+exit(1);
+#endif
+struct msghdr m;
+m.msg_accrights = 0;
+exit(0);
+}
 		],
-		[ struct msghdr m; m.msg_accrights = 0; ],
 		[ ac_cv_have_accrights_in_msghdr="yes" ],
 		[ ac_cv_have_accrights_in_msghdr="no" ]
 	)
@@ -1518,13 +1526,20 @@
 
 AC_CACHE_CHECK([for msg_control field in struct msghdr],
 		ac_cv_have_control_in_msghdr, [
-	AC_TRY_COMPILE(
+	AC_TRY_RUN(
 		[
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
+int main() {
+#ifdef msg_control
+exit(1);
+#endif
+struct msghdr m;
+m.msg_control = 0;
+exit(0);
+}
 		],
-		[ struct msghdr m; m.msg_control = 0; ],
 		[ ac_cv_have_control_in_msghdr="yes" ],
 		[ ac_cv_have_control_in_msghdr="no" ]
 	)
--- openssh/monitor_fdpass.c.old	Sat May 11 15:20:08 2002
+++ openssh/monitor_fdpass.c	Thu May 23 21:15:32 2002
@@ -39,14 +39,13 @@
 	struct iovec vec;
 	char ch = '\0';
 	int n;
-#if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \
-	(defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR))
+#ifndef HAVE_ACCRIGHTS_IN_MSGHDR
 	char tmp[CMSG_SPACE(sizeof(int))];
 	struct cmsghdr *cmsg;
 #endif
 
 	memset(&msg, 0, sizeof(msg));
-#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR)
+#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
 	msg.msg_accrights = (caddr_t)&fd;
 	msg.msg_accrightslen = sizeof(fd);
 #else
@@ -84,8 +83,7 @@
 	struct iovec vec;
 	char ch;
 	int fd, n;
-#if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \
-	(defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR))
+#ifndef HAVE_ACCRIGHTS_IN_MSGHDR
 	char tmp[CMSG_SPACE(sizeof(int))];
 	struct cmsghdr *cmsg;
 #endif
@@ -95,7 +93,7 @@
 	vec.iov_len = 1;
 	msg.msg_iov = &vec;
 	msg.msg_iovlen = 1;
-#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR)
+#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
 	msg.msg_accrights = (caddr_t)&fd;
 	msg.msg_accrightslen = sizeof(fd);
 #else
@@ -109,7 +107,7 @@
 		fatal("%s: recvmsg: expected received 1 got %d",
 		    __FUNCTION__, n);
 
-#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR)
+#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
 	if (msg.msg_accrightslen != sizeof(fd))
 		fatal("%s: no fd", __FUNCTION__);
 #else


More information about the openssh-unix-dev mailing list