Add default for rm

This commit is contained in:
Isaac Connor
2025-09-22 09:08:05 -04:00
parent 643fe97b25
commit f526f26282

View File

@@ -174,6 +174,10 @@ sub delete_path {
my $storage_path = $self->Path();
($storage_path) = ($storage_path =~ /^(.*)$/); # De-taint
($path) = ($path =~ /^(.*)$/); # De-taint
if (!$Config{ZM_PATH_RM}) {
Info('No value set for ZM_PATH_RM. ZM_PATH_RM should have been set automatically by the distro in '.$config{ZM_CONFIG_DIR}.'/conf.d/01-system-paths.conf. Defaulting to /bin/rm');
$Config{ZM_PATH_RM} = '/bin/rm';
}
my $command = "$Config{ZM_PATH_RM} -rf $storage_path/$path 2>&1";
if (ZoneMinder::General::executeShellCommand($command)) {
Error("Error deleting event directory at $storage_path/$path using $command");