From 243edcc82fc2708820cc1d2ed19a4be405033cde Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 28 Sep 2023 12:59:08 -0400 Subject: [PATCH] Use new ZM_PATH_RM instead of hard coding path to rm --- scripts/ZoneMinder/lib/ZoneMinder/Storage.pm | 2 +- scripts/zmaudit.pl.in | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Storage.pm b/scripts/ZoneMinder/lib/ZoneMinder/Storage.pm index 016cafe18..0d8c8c062 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Storage.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Storage.pm @@ -174,7 +174,7 @@ sub delete_path { my $storage_path = $self->Path(); ($storage_path) = ($storage_path =~ /^(.*)$/); # De-taint ($path) = ($path =~ /^(.*)$/); # De-taint - my $command = "/bin/rm -rf $storage_path/$path 2>&1"; + 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"); } diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index f1a88ffc9..f0ad762e5 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -408,7 +408,7 @@ MAIN: while( $loop ) { } aud_print("Deleting event directories with no event id information at $day_dir/$event_dir"); if ( confirm() ) { - executeShellCommand("rm -rf $event_dir"); + executeShellCommand($Config{ZM_PATH_RM}.' -rf '.$event_dir); $cleaned = 1; } } # end if able to find id @@ -515,7 +515,7 @@ MAIN: while( $loop ) { aud_print("Filesystem monitor '$monitor_id' in $$Storage{Path} does not exist in database"); if ( confirm() ) { - executeShellCommand("rm -rf $monitor_id"); + executeShellCommand($Config{ZM_PATH_RM}.' -rf '.$monitor_id); $cleaned = 1; } } @@ -529,7 +529,7 @@ MAIN: while( $loop ) { aud_print("Filesystem monitor link '$link' does not point to valid monitor directory"); if ( confirm() ) { ( $link ) = ( $link =~ /^(.*)$/ ); # De-taint - executeShellCommand(qq`rm "$link"`); + executeShellCommand($Config{ZM_PATH_RM}.qq` "$link"`); $cleaned = 1; } } # end foreach monitor link