From a14c663f8579cb097aa2d40a5a556703173b183b Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 30 Sep 2015 00:37:44 +0200 Subject: Stop creating log_dir here to avoid stupid recursive chown on / bug It's been already done squid_resync_general() in the first place, not needed at all. Leaving the squid_chown_recursive() safety checks in place, certainly good this to have here regardless. --- config/squid3/34/squid.inc | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'config/squid3/34') diff --git a/config/squid3/34/squid.inc b/config/squid3/34/squid.inc index a7cb0490..d017852f 100755 --- a/config/squid3/34/squid.inc +++ b/config/squid3/34/squid.inc @@ -959,6 +959,7 @@ function squid_resync_general() { $logdir = ($settings['log_dir'] ? $settings['log_dir'] : '/var/squid/logs'); if (!is_dir($logdir)) { + log_error("Creating Squid log dir $logdir"); safe_mkdir($logdir, 0755); squid_chown_recursive($logdir, SQUID_UID, SQUID_GID); } @@ -1951,7 +1952,6 @@ function squid_resync($via_rpc = "no") { chgrp(SQUID_LOCALBASE . "/libexec/squid/pinger", SQUID_GID); } - $log_dir = ""; $squid_enabled = false; if (is_array($config['installedpackages']['squid']['config'])) { // check if Squid is enabled @@ -1964,19 +1964,6 @@ function squid_resync($via_rpc = "no") { $squid_enabled = true; } } - // create log dir if required - if (is_array($config['installedpackages']['squid']['config'])) { - if ($config['installedpackages']['squid']['config'][0]['log_dir'] != "") { - $log_dir = $config['installedpackages']['squid']['config'][0]['log_dir'] . '/'; - } - } else { - $log_dir = "/var/squid/logs/"; - } - if (!is_dir($log_dir)) { - log_error("Creating Squid log dir $log_dir"); - safe_mkdir($log_dir, 0755); - squid_chown_recursive($log_dir, SQUID_UID, SQUID_GID); - } // check cache dir and create if necessary squid_dash_z(); -- cgit v1.2.3