soften the file cleaning to reduce risk

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-01-07 23:31:39 +01:00
parent af55fe5b82
commit 73868b7947

View File

@@ -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);
}