summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-08-21 17:38:20 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-08-21 17:38:20 +1000
commitacc0d05cbc880c4caf52cf6956fc3ea23cb81d39 (patch)
tree4bf141de46cdc0fbc07ca901919330e9f0c2ec1d
parent1df4bb2b64e0688dc6999e309ae829b2e2c2715f (diff)
- (dtucker) [configure.ac monitor_fdpass.c] Bug #544: ignore invalid cmsg_type
on Linux 1.x and 2.0 kernels, privsep should now work.
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac6
-rw-r--r--monitor_fdpass.c2
3 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a9005a5..585e03ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,8 @@
- (dtucker) [defines.h] Bug #336: Add CMSG_DATA and CMSG_FIRSTHDR macros if
not already defined (eg Linux with some versions of libc5), based on those
from OpenBSD.
+ - (dtucker) [configure.ac monitor_fdpass.c] Bug #544: ignore invalid cmsg_type
+ on Linux 1.x and 2.0 kernels, privsep should now work.
20030429
- (djm) Add back radix.o (used by AFS support), after it went missing from
@@ -1317,4 +1319,4 @@
save auth method before monitor_reset_key_state(); bugzilla bug #284;
ok provos@
-$Id: ChangeLog,v 1.2648.2.6 2003/08/21 07:08:43 dtucker Exp $
+$Id: ChangeLog,v 1.2648.2.7 2003/08/21 07:38:20 dtucker Exp $
diff --git a/configure.ac b/configure.ac
index 6ba2af6f..3d785905 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.113.2.2 2003/08/21 06:16:21 dtucker Exp $
+# $Id: configure.ac,v 1.113.2.3 2003/08/21 07:38:20 dtucker Exp $
AC_INIT
AC_CONFIG_SRCDIR([ssh.c])
@@ -188,6 +188,10 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
inet6_default_4in6=yes
+ case `uname -r` in
+ 1.*|2.0.*)
+ AC_DEFINE(BROKEN_CMSG_TYPE)
+ esac
;;
mips-sony-bsd|mips-sony-newsos4)
AC_DEFINE(HAVE_NEWS4)
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index 641ce721..22b7882b 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -113,9 +113,11 @@ mm_receive_fd(int socket)
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;