Use new ZM_PATH_RM instead of hard coding path to rm

This commit is contained in:
Isaac Connor
2023-09-28 12:59:08 -04:00
parent cc773eae43
commit 243edcc82f
2 changed files with 4 additions and 4 deletions

View File

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

View File

@@ -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