From 3be0ea28e51117fd759a05b87a2d0cad950f1a7e Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 16 Aug 2010 17:17:59 -0700 Subject: [PATCH] Fix bug parsing menu files on remote system --- custom/custom-lib.pl | 8 ++++---- custom/run.cgi | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/custom/custom-lib.pl b/custom/custom-lib.pl index e1c0b3c86..506ed6d18 100755 --- a/custom/custom-lib.pl +++ b/custom/custom-lib.pl @@ -376,13 +376,13 @@ for($i=0; defined($name = $in{"name_$i"}); $i++) { } } -# set_parameter_envs(&command, command-str, &uinfo, [set-in]) +# set_parameter_envs(&command, command-str, &uinfo, [set-in], [skip-menu-check]) # Sets $ENV variables based on parameter inputs, and returns the list of # environment variable commands, the export commands, the command string, # and the command string to display. sub set_parameter_envs { -local ($cmd, $str, $uinfo, $setin) = @_; +local ($cmd, $str, $uinfo, $setin, $skipfound) = @_; $setin ||= \%in; local $displaystr = $str; local ($env, $export, @vals); @@ -414,7 +414,7 @@ foreach my $a (@{$cmd->{'args'}}) { foreach my $l (&read_opts_file($a->{'opts'})) { $found++ if ($l->[0] eq $setin->{$n}); } - $found || &error($text{'run_eopt'}); + $found || $skipfound || &error($text{'run_eopt'}); $rv = $setin->{$n}; } elsif ($a->{'type'} == 10) { @@ -439,7 +439,7 @@ foreach my $a (@{$cmd->{'args'}}) { foreach my $l (@opts) { $found++ if ($l->[0] eq $v); } - $found || &error($text{'run_eopt'}); + $found || $skipfound || &error($text{'run_eopt'}); } $rv = join(" ", @vals); } diff --git a/custom/run.cgi b/custom/run.cgi index 6c5fe5c7c..ba4340d49 100755 --- a/custom/run.cgi +++ b/custom/run.cgi @@ -60,7 +60,7 @@ foreach $h (@hosts) { "custom-lib.pl"); &remote_foreign_call($server->{'host'}, "custom", "set_parameter_envs", $cmd, $cmd->{'cmd'}, - \@user_info, \%in); + \@user_info, \%in, 1); ($got, $out, $timeout) = &remote_foreign_call( $server->{'host'}, "custom", "execute_custom_command", $cmd, $env, $export, $str);