From: wessels <> Date: Fri, 7 Feb 1997 02:01:46 +0000 (+0000) Subject: bail on root X-Git-Tag: SQUID_3_0_PRE1~5129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d41a5e15d92b5854c778a1124acebdadc541a497;p=thirdparty%2Fsquid.git bail on root --- diff --git a/src/main.cc b/src/main.cc index 6a68255524..d3520fc8d1 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ /* - * $Id: main.cc,v 1.133 1997/01/22 22:02:38 wessels Exp $ + * $Id: main.cc,v 1.134 1997/02/06 19:01:46 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -527,6 +527,13 @@ mainInitialize(void) parseConfigFile(ConfigFile); leave_suid(); /* Run as non privilegied user */ + if (geteuid() == 0) { + debug(0,0,"Squid is not safe to run as root! If you must\n"); + debug(0,0,"start Squid as root, then you must configure\n"); + debug(0,0,"it to run as a non-priveledged user with the\n"); + debug(0,0,"'cache_effective_user' option in the config file.\n"); + fatal("Don't run Squid as root, set 'cache_effective_user'!"); + } if (httpPortNumOverride != 1) Config.Port.http = (u_short) httpPortNumOverride;