--------------------- PatchSet 11619 Date: 2007/08/31 21:58:40 Author: hno Branch: HEAD Tag: (none) Log: Test for sys/capability.h linux include file to avoid failing on systems missing libcap not all Linux systems have libcap development files installed.. Members: configure.in:1.427->1.428 src/tools.c:1.258->1.259 Index: squid/configure.in =================================================================== RCS file: /cvsroot/squid/squid/configure.in,v retrieving revision 1.427 retrieving revision 1.428 diff -u -r1.427 -r1.428 --- squid/configure.in 25 Jun 2007 10:16:11 -0000 1.427 +++ squid/configure.in 31 Aug 2007 21:58:40 -0000 1.428 @@ -1,7 +1,7 @@ dnl dnl Configuration input file for Squid dnl -dnl $Id: configure.in,v 1.427 2007/06/25 10:16:11 hno Exp $ +dnl $Id: configure.in,v 1.428 2007/08/31 21:58:40 hno Exp $ dnl dnl dnl @@ -10,7 +10,7 @@ AM_CONFIG_HEADER(include/autoconf.h) AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE -AC_REVISION($Revision: 1.427 $)dnl +AC_REVISION($Revision: 1.428 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -1665,6 +1665,7 @@ db.h \ db_185.h \ aio.h \ + sys/capability.h \ ,,,[ #if HAVE_SYS_TYPES_H #include Index: squid/src/tools.c =================================================================== RCS file: /cvsroot/squid/squid/src/tools.c,v retrieving revision 1.258 retrieving revision 1.259 diff -u -r1.258 -r1.259 --- squid/src/tools.c 15 Aug 2007 01:54:56 -0000 1.258 +++ squid/src/tools.c 31 Aug 2007 21:58:40 -0000 1.259 @@ -1,6 +1,6 @@ /* - * $Id: tools.c,v 1.258 2007/08/15 01:54:56 hno Exp $ + * $Id: tools.c,v 1.259 2007/08/31 21:58:40 hno Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -41,6 +41,7 @@ #include "squid.h" #ifdef _SQUID_LINUX_ +#if HAVE_SYS_CAPABILITY_H #undef _POSIX_SOURCE /* Ugly glue to get around linux header madness colliding with glibc */ #define _LINUX_TYPES_H @@ -48,6 +49,7 @@ typedef uint32_t __u32; #include #endif +#endif #if HAVE_SYS_PRCTL_H #include @@ -1339,7 +1341,7 @@ void keepCapabilities(void) { -#if HAVE_PRCTL && defined(PR_SET_KEEPCAPS) +#if HAVE_PRCTL && defined(PR_SET_KEEPCAPS) && HAVE_SYS_CAPABILITY_H if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0)) { /* Silent failure unless TPROXY is required. Maybe not started as root */ #if LINUX_TPROXY @@ -1354,7 +1356,7 @@ static void restoreCapabilities(int keep) { -#ifdef _SQUID_LINUX_ +#if defined(_SQUID_LINUX_) && HAVE_SYS_CAPABILITY_H cap_user_header_t head = (cap_user_header_t) xcalloc(1, sizeof(cap_user_header_t)); cap_user_data_t cap = (cap_user_data_t) xcalloc(1, sizeof(cap_user_data_t)); @@ -1388,6 +1390,12 @@ nocap: xfree(head); xfree(cap); +#else +#if LINUX_TPROXY + if (need_linux_tproxy) + debug(50, 1) ("Missing needed capability support. Will continue without tproxy support\n"); + need_linux_tproxy = 0; +#endif #endif }