- (dtucker) Bug #544: ignore invalid cmsg_type on Linux 2.0 kernels,
   privsep should now work.
diff --git a/ChangeLog b/ChangeLog
index d532409..a3bf765 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+20030502
+ - (dtucker) Bug #544: ignore invalid cmsg_type on Linux 2.0 kernels,
+   privsep should now work.
+
 20030429
  - (djm) Add back radix.o (used by AFS support), after it went missing from
    Makefile many moons ago
@@ -1356,4 +1360,4 @@
      save auth method before monitor_reset_key_state(); bugzilla bug #284;
      ok provos@
 
-$Id: ChangeLog,v 1.2664 2003/04/29 13:22:40 djm Exp $
+$Id: ChangeLog,v 1.2665 2003/05/02 10:48:21 dtucker Exp $
diff --git a/acconfig.h b/acconfig.h
index b6e4b37..6164ecc 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,4 +1,4 @@
-/* $Id: acconfig.h,v 1.149 2003/03/10 00:38:10 djm Exp $ */
+/* $Id: acconfig.h,v 1.150 2003/05/02 10:48:21 dtucker Exp $ */
 
 #ifndef _CONFIG_H
 #define _CONFIG_H
@@ -377,6 +377,9 @@
 /* Pushing STREAMS modules incorrectly acquires a controlling TTY */
 #undef STREAMS_PUSH_ACQUIRES_CTTY
 
+/* Define if cmsg_type is not passed correctly */
+#undef BROKEN_CMSG_TYPE
+
 @BOTTOM@
 
 /* ******************* Shouldn't need to edit below this line ************** */
diff --git a/configure.ac b/configure.ac
index 38cc4d4..d6726ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.114 2003/04/29 13:22:40 djm Exp $
+# $Id: configure.ac,v 1.115 2003/05/02 10:48:21 dtucker Exp $
 
 AC_INIT
 AC_CONFIG_SRCDIR([ssh.c])
@@ -188,6 +188,16 @@
 	AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
 	AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
 	inet6_default_4in6=yes
+	AC_MSG_CHECKING(for broken cmsg_type)
+	case `uname -r` in
+	2.0.*)
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(BROKEN_CMSG_TYPE)
+		;;
+	*)
+		AC_MSG_RESULT(no)
+		;;
+	esac
 	;;
 mips-sony-bsd|mips-sony-newsos4)
 	AC_DEFINE(HAVE_NEWS4)
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index 641ce72..22b7882 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -113,9 +113,11 @@
 		fatal("%s: no fd", __func__);
 #else
 	cmsg = CMSG_FIRSTHDR(&msg);
+#ifndef BROKEN_CMSG_TYPE
 	if (cmsg->cmsg_type != SCM_RIGHTS)
 		fatal("%s: expected type %d got %d", __func__,
 		    SCM_RIGHTS, cmsg->cmsg_type);
+#endif
 	fd = (*(int *)CMSG_DATA(cmsg));
 #endif
 	return fd;