From: amosjeffries <> Date: Sun, 26 Aug 2007 08:32:52 +0000 (+0000) Subject: Add --with-default-user=USER option to squid. X-Git-Tag: SQUID_3_0_PRE7~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5483d91696eaa16e3fb6eb36b2475d2de4bf953b;p=thirdparty%2Fsquid.git Add --with-default-user=USER option to squid. This option allows configure-time control of the default user which squid uses to run as low-privileges. The default remains 'nobody' as in other squid releases. Similarly the cache_effective_user squid.conf setting will override any default set here. --- diff --git a/configure.in b/configure.in index 255b3f3632..6f9d5858a2 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl Configuration input file for Squid dnl -dnl $Id: configure.in,v 1.465 2007/08/24 02:26:52 amosjeffries Exp $ +dnl $Id: configure.in,v 1.466 2007/08/26 02:32:52 amosjeffries Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AM_CONFIG_HEADER(include/autoconf.h) AC_CONFIG_AUX_DIR(cfgaux) AC_CONFIG_SRCDIR([src/main.cc]) AM_INIT_AUTOMAKE([tar-ustar]) -AC_REVISION($Revision: 1.465 $)dnl +AC_REVISION($Revision: 1.466 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -102,6 +102,14 @@ AC_DEFINE_UNQUOTED(CONFIG_HOST_TYPE, "$host",[Host type from configure]) AC_DEFINE_UNQUOTED(SQUID_CONFIGURE_OPTIONS, "$ac_configure_args", [configure command line used to configure Squid]) +CACHE_EFFECTIVE_USER="nobody" +AC_ARG_WITH(default-user, + [ --with-default-user=USER System user account for squid permissions. + default: nobody], + [ CACHE_EFFECTIVE_USER="$withval" ] +) +AC_SUBST(CACHE_EFFECTIVE_USER) + dnl Gerben Wierda case "$host" in mab-next-nextstep3) diff --git a/src/Makefile.am b/src/Makefile.am index 08417c0a6f..0b04c6b423 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.am,v 1.185 2007/08/14 11:55:15 amosjeffries Exp $ +# $Id: Makefile.am,v 1.186 2007/08/26 02:32:53 amosjeffries Exp $ # # Uncomment and customize the following to suit your needs: # @@ -1037,6 +1037,7 @@ cf.data: cf.data.pre Makefile sed "\ s%@DEFAULT_HTTP_PORT@%$(DEFAULT_HTTP_PORT)%g;\ s%@DEFAULT_ICP_PORT@%$(DEFAULT_ICP_PORT)%g;\ + s%@DEFAULT_CACHE_EFFECTIVE_USER@%${CACHE_EFFECTIVE_USER}%g;\ s%@DEFAULT_MIME_TABLE@%$(DEFAULT_MIME_TABLE)%g;\ s%@DEFAULT_DNSSERVER@%$(DEFAULT_DNSSERVER)%g;\ s%@DEFAULT_UNLINKD@%$(DEFAULT_UNLINKD)%g;\ diff --git a/src/cf.data.pre b/src/cf.data.pre index bb3610db0b..02546dc44b 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.457 2007/08/21 23:59:42 hno Exp $ +# $Id: cf.data.pre,v 1.458 2007/08/26 02:32:54 amosjeffries Exp $ # # SQUID Web Proxy Cache http://www.squid-cache.org/ # ---------------------------------------------------------- @@ -3177,16 +3177,16 @@ DOC_END NAME: cache_effective_user TYPE: string -DEFAULT: nobody +DEFAULT: @DEFAULT_CACHE_EFFECTIVE_USER@ LOC: Config.effectiveUser DOC_START If you start Squid as root, it will change its effective/real UID/GID to the user specified below. The default is to change - to UID to nobody. If you define cache_effective_user, but not - cache_effective_group, Squid sets the GID to the effective - user's default group ID (taken from the password file) and - supplementary group list from the from groups membership of - cache_effective_user. + to UID of @DEFAULT_CACHE_EFFECTIVE_USER@. + If you define cache_effective_user, but not cache_effective_group, + Squid sets the GID to the effective user's default group ID + (taken from the password file) and supplementary group list from + the from groups membership of cache_effective_user. DOC_END NAME: cache_effective_group