]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
bail on root
authorwessels <>
Fri, 7 Feb 1997 02:01:46 +0000 (02:01 +0000)
committerwessels <>
Fri, 7 Feb 1997 02:01:46 +0000 (02:01 +0000)
src/main.cc

index 6a6825552420bda6b55e42754d9fc5aa1a366184..d3520fc8d132f25f9c3b7f6b7f72a6c05e732d4a 100644 (file)
@@ -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;