From bf7c1e6cbac1b1cc368226cf931db8d0014657fc Mon Sep 17 00:00:00 2001 From: dtucker Date: Fri, 2 May 2003 10:48:21 +0000 Subject: [PATCH] - (dtucker) Bug #544: ignore invalid cmsg_type on Linux 2.0 kernels, privsep should now work. --- ChangeLog | 4 ++++ acconfig.h | 3 +++ configure.ac | 10 ++++++++++ monitor_fdpass.c | 2 ++ 4 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index c6ad9d4b..6221d0ef 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 diff --git a/acconfig.h b/acconfig.h index 3b919d55..b4a7955d 100644 --- a/acconfig.h +++ b/acconfig.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 dfd87c9d..c269b7fd 100644 --- a/configure.ac +++ b/configure.ac @@ -188,6 +188,16 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 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 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; -- 2.45.1