Inline below is a simple patch that drops the root capabilities that
aren't needed (inspired by a similar patch against the mpm_itk
project!). Possibly it is a little too restrictive, extras can be
added to suidcaps, but on platforms that support capabilities this
will prevent things such as kernel module loading.
Needed on linux is libcap, available in most distros. Note that this
patch doesn't require libcap, or add an option, but if it is installed
then it will take advantage of it. I don't have any other platforms
to test on.
The patch compiles fine but I haven't managed to test it yet. My
autoconf experience is zero, so I hope that HAVE_LIBCAP is actually
getting defined.
Comments appreciated, I'll test it thoroughly later when I get some
free time (and, if it works, remove the test message!).
David
--- configure.in 2007-02-22 21:50:07.000000000 +0000
+++ configure.in 2007-02-23 17:52:16.000000000 +0000
@@ -382,6 +382,17 @@
])
])
+AC_CHECK_FUNC(cap_init, [], [
+ AC_CHECK_LIB(cap, cap_init, [
+ have_libcap=yes
+ LIBS="$LIBS -lcap"
+ ])
+])
+
+if test "$have_libcap" = "yes"; then
+ AC_DEFINE(HAVE_LIBCAP,, libcap is installed for cap_init())
+fi
+
AC_CHECK_FUNC(fdatasync, [
have_fdatasync=yes
], [
--- src/master/main.c 2007-01-27 01:44:25.000000000 +0000
+++ src/master/main.c 2007-02-23 16:13:39.000000000 +0000
@@ -24,6 +24,9 @@
#include