From 73868b794774567bbd8e5f3bc1c07a7cd6a95b14 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Sun, 7 Jan 2018 23:31:39 +0100 Subject: [PATCH] soften the file cleaning to reduce risk Signed-off-by: Michael Kaufmann (d00p) --- lib/classes/webserver/class.ConfigIO.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/classes/webserver/class.ConfigIO.php b/lib/classes/webserver/class.ConfigIO.php index 10fe1b50..14e95085 100644 --- a/lib/classes/webserver/class.ConfigIO.php +++ b/lib/classes/webserver/class.ConfigIO.php @@ -65,7 +65,7 @@ class ConfigIO // now get rid of old stuff // (but append /*.log so we don't delete the directory) $err_dir .= '/*.log'; - safe_exec('rm -rf ' . makeCorrectFile($err_dir)); + safe_exec('rm -f ' . makeCorrectFile($err_dir)); } } @@ -92,7 +92,7 @@ class ConfigIO // now get rid of old stuff // (but append /* so we don't delete the directory) $configdir .= '/*'; - safe_exec('rm -rf ' . makeCorrectFile($configdir)); + safe_exec('rm -f ' . makeCorrectFile($configdir)); } } } @@ -159,7 +159,7 @@ class ConfigIO // now get rid of old stuff // (but append /* so we don't delete the directory) $configdir .= '/*'; - safe_exec('rm -rf ' . makeCorrectFile($configdir)); + safe_exec('rm -f ' . makeCorrectFile($configdir)); } } } @@ -269,9 +269,9 @@ class ConfigIO $configdir = makeCorrectDir($configdir['config_dir']); if (@is_dir($configdir)) { // now get rid of old stuff - // (but append /* so we don't delete the directory) - $configdir .= '/*'; - safe_exec('rm -rf ' . makeCorrectFile($configdir)); + // (but append /*.conf so we don't delete the directory) + $configdir .= '/*.conf'; + safe_exec('rm -f ' . makeCorrectFile($configdir)); } else { safe_exec('mkdir -p ' . $configdir); }