]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Changed my mint how to regain root privs when rereading the configuration.
authorhno <>
Tue, 15 Jan 2002 23:49:19 +0000 (23:49 +0000)
committerhno <>
Tue, 15 Jan 2002 23:49:19 +0000 (23:49 +0000)
this is better placed in main.c.

src/cache_cf.cc
src/main.cc

index b40740e22dd0bbbb04dc434a84c7a6a9f970008a..a72d0696a076f77dbf859cd1465cb11b96a470f3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.399 2002/01/15 16:26:41 hno Exp $
+ * $Id: cache_cf.cc,v 1.400 2002/01/15 16:49:19 hno Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -239,7 +239,6 @@ parseConfigFile(const char *file_name)
     int err_count = 0;
     configFreeMemory();
     default_all();
-    enter_suid();
     if ((fp = fopen(file_name, "r")) == NULL)
        fatalf("Unable to open configuration file: %s: %s",
            file_name, xstrerror());
@@ -270,7 +269,6 @@ parseConfigFile(const char *file_name)
        safe_free(tmp_line);
     }
     fclose(fp);
-    leave_suid();
     defaults_if_none();
     configDoConfigure();
     cachemgrRegister("config",
index 777fa43a6925e7fd29b13b37cd3bdf8efb60a69b..05e28aa006330ae51235ff1846f753e2fbe85a54 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.346 2001/12/24 15:33:43 adrian Exp $
+ * $Id: main.cc,v 1.347 2002/01/15 16:49:19 hno Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -346,7 +346,9 @@ mainReconfigure(void)
     authenticateShutdown();
     storeDirCloseSwapLogs();
     errorClean();
+    enter_suid();              /* root to read config file */
     parseConfigFile(ConfigFile);
+    setEffectiveUser();
     _db_init(Config.Log.log, Config.debugOptions);
     ipcache_restart();         /* clear stuck entries */
     authenticateUserCacheRestart();    /* clear stuck ACL entries */