mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Fix status detection on running cmd with set input or cmd containing special chars
This commit is contained in:
@@ -1406,7 +1406,19 @@ else {
|
||||
$eos = '$';
|
||||
}
|
||||
}
|
||||
($proc) = grep { $_->{'args'} =~ /\Q$cmd\E$eos/ &&
|
||||
|
||||
# If `Input to command` is set, remove it for test case
|
||||
# otherwise cmd will always be displayed as not running
|
||||
my $cmd_ = $cmd;
|
||||
|
||||
# First remove only input to command and preserve
|
||||
# potential arguments containing escaped %, like \\%
|
||||
$cmd_ =~ s/(?<!\\)%.*//;
|
||||
|
||||
# Now replace escaped \\ special chars for testing purposes
|
||||
$cmd_ =~ s/\\//g;
|
||||
|
||||
($proc) = grep { $_->{'args'} =~ /\Q$cmd_\E$eos/ &&
|
||||
(!$config{'match_user'} || $_->{'user'} eq $_[0]->{'user'}) }
|
||||
@procs;
|
||||
if (!$proc && $cmd =~ /^$config_directory\/(.*\.pl)(.*)$/) {
|
||||
|
||||
Reference in New Issue
Block a user