summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniil Baturin <daniil.baturin@vyatta.com>2012-03-23 00:32:29 +0700
committerDaniil Baturin <daniil.baturin@vyatta.com>2012-03-23 00:32:29 +0700
commita97c203863e2e6b052897dcd4b0e7e5e3c0805a0 (patch)
tree98e666a52600fc484de74448a416ebe93165d364 /lib
parentfd6a1acd460e8dd5ec33846a8813716199334eac (diff)
downloadvyatta-nat-a97c203863e2e6b052897dcd4b0e7e5e3c0805a0.tar.gz
vyatta-nat-a97c203863e2e6b052897dcd4b0e7e5e3c0805a0.zip
Bug #7655: add both leading and trailing spaces to iptables
options to ensure nothing gets adhered.
Diffstat (limited to 'lib')
-rw-r--r--lib/Vyatta/DstNatRule.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Vyatta/DstNatRule.pm b/lib/Vyatta/DstNatRule.pm
index e95cc7b..222010f 100644
--- a/lib/Vyatta/DstNatRule.pm
+++ b/lib/Vyatta/DstNatRule.pm
@@ -160,15 +160,15 @@ sub rule_str {
$str =~ s/^\!(.*)$/! $1/;
if ($str eq 'tcp_udp') {
$tcp_and_udp = 1;
- $rule_str .= " -p tcp"; # we'll add the '-p udp' to 2nd rule later
+ $rule_str .= " -p tcp "; # we'll add the '-p udp' to 2nd rule later
} else {
- $rule_str .= " -p $str";
+ $rule_str .= " -p $str ";
}
}
if (defined($self->{_inbound_if})) {
if ($self->{_inbound_if} ne "any") {
- $rule_str .= " -i $self->{_inbound_if}";
+ $rule_str .= " -i $self->{_inbound_if} ";
}
} else {
# make this a requirement to prevent users from
@@ -289,7 +289,7 @@ sub rule_str {
if ($tcp_and_udp == 1) {
$comment = "\"$type-NAT-$self->{_rule_number} tcp_udp\" ";
}
- $rule_str .= "$src_str $dst_str" . " -m comment --comment " . $comment;
+ $rule_str .= "$src_str $dst_str" . " -m comment --comment " . $comment . " ";
if ("$self->{_log}" eq "enable") {
my $rule_num = $self->{_rule_number};
my $log_prefix = get_log_prefix($rule_num, $type, $log_modifier);