/*
- * $Id: cache_cf.cc,v 1.369 2001/01/12 00:37:14 wessels Exp $
+ * $Id: cache_cf.cc,v 1.370 2001/01/25 22:54:52 hno Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
}
if (aclPurgeMethodInUse(Config.accessList.http))
Config2.onoff.enable_purge = 1;
- if (NULL != Config.effectiveUser) {
- struct passwd *pwd = getpwnam(Config.effectiveUser);
- if (NULL == pwd)
+ if (geteuid() == 0) {
+ if (NULL != Config.effectiveUser) {
+ struct passwd *pwd = getpwnam(Config.effectiveUser);
+ if (NULL == pwd)
/*
* Andres Kroonmaa <andre@online.ee>:
* Some getpwnam() implementations (Solaris?) require
* This should be safe at startup, but might still fail
* during reconfigure.
*/
- fatalf("getpwnam failed to find userid for effective user '%s'",
- Config.effectiveUser,
- xstrerror());
- Config2.effectiveUserID = pwd->pw_uid;
+ fatalf("getpwnam failed to find userid for effective user '%s'",
+ Config.effectiveUser,
+ xstrerror());
+ Config2.effectiveUserID = pwd->pw_uid;
+ Config2.effectiveGroupID = pwd->pwd_gid;
+ }
+ } else {
+ Config2.effectiveUserID = geteuid();
+ Config2.effectiveGroupID = getegid();
}
if (NULL != Config.effectiveGroup) {
struct group *grp = getgrnam(Config.effectiveGroup);
#
-# $Id: cf.data.pre,v 1.207 2001/01/12 00:37:15 wessels Exp $
+# $Id: cf.data.pre,v 1.208 2001/01/25 22:54:52 hno Exp $
#
#
# SQUID Web Proxy Cache http://www.squid-cache.org/
NAME: cache_effective_group
TYPE: string
-DEFAULT: nogroup
+DEFAULT: none
LOC: Config.effectiveGroup
DOC_START
If the cache is run as root, it will change its effective/real
UID/GID to the UID/GID specified below. The default is to
- change to UID to nobody and GID to nogroup.
+ change to UID to nobody and GID to the default group of nobody.
If Squid is not started as root, the default is to keep the
- current UID/GID. Note that if Squid is not started as root then
- you cannot set http_port to a value lower than 1024.
+ current UID/GID, and only the GID can be changed to any of
+ the groups the user starting Squid is member of. Note that if
+ Squid is not started as root then you cannot set http_port to
+ a value lower than 1024.
DOC_END