From: hno <> Date: Tue, 15 Jan 2002 23:49:19 +0000 (+0000) Subject: Changed my mint how to regain root privs when rereading the configuration. X-Git-Tag: SQUID_3_0_PRE1~1203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3aa4adbc0ff1ffca7e8fafeebaf2f4bdc00b78c5;p=thirdparty%2Fsquid.git Changed my mint how to regain root privs when rereading the configuration. this is better placed in main.c. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index b40740e22d..a72d0696a0 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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", diff --git a/src/main.cc b/src/main.cc index 777fa43a69..05e28aa006 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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 */