diff --git a/ipsec/up.cgi b/ipsec/up.cgi index 0d36d7f4c..3c0de3121 100755 --- a/ipsec/up.cgi +++ b/ipsec/up.cgi @@ -8,8 +8,15 @@ $| = 1; $theme_no_table++; &ui_print_header(undef, $text{'up_title'}, ""); +# Validate connection name against configured connections +my @conf = &get_config(); +my %ok_conns = map { $_->{'value'}, 1 } + grep { $_->{'name'} eq 'conn' && $_->{'value'} ne '%default' } + @conf; +$ok_conns{$in{'conn'}} || &error($text{'save_ename'}); + # Try to connect -$cmd = "$config{'ipsec'} auto --up '$in{'conn'}'"; +$cmd = "$config{'ipsec'} auto --up ".quotemeta($in{'conn'}); print "",&text('up_cmd', "$cmd"),"\n"; print "
";
 &foreign_require("proc", "proc-lib.pl");