hi,
i''ve got such a Knock action (which was worked with the shell compiler)
while action.Knock is empty and actions contains Knock. it has a bug, or
won''t works with perl or what should i do?
thanks in advance.
------------------------------------------
set -- $(separate_list $TAG)
[ $# -eq 3 ] || fatal_error "Rule must include <port>,<knock
port>,<interval> as the log tag"
if [ -n "$LEVEL" ]; then
log_rule_limit $LEVEL $CHAIN Knock-$1 ACCEPT ""
"Knock-$1" -A -p
tcp --dport $1 -m recent --rcheck --name Knock-$1
log_rule_limit $LEVEL $CHAIN Knock-$1 DROP ""
"Knock-$1" -A -p
tcp --dport ! $1
fi
run_iptables -A $CHAIN -p tcp --dport $1 -m recent --rcheck
--seconds $3 --name Knock-$1 -j ACCEPT
run_iptables -A $CHAIN -p tcp --dport $(( $2 - 1 )) -m recent
--name Knock-$1 --remove -j DROP
run_iptables -A $CHAIN -p tcp --dport $2 -m recent
--name Knock-$1 --set -j DROP
run_iptables -A $CHAIN -p tcp --dport $(( $2 + 1 )) -m recent
--name Knock-$1 --remove -j DROP
------------------------------------------
i use rules like this:
------------------------------------------
Knock:none:22,2222,60 net fw:$NET_IP tcp ssh,2221,2222,2223
------------------------------------------
and gives me this error:
------------------------------------------
Scalar found where operator expected at (eval 6) line 1, near "-- $("
(Missing operator before $(?)
Bareword found where operator expected at (eval 6) line 1, near
"$(separate_list"
(Missing operator before separate_list?)
Use of $# is deprecated at (eval 6) line 3, <$currentfile> line 34.
String found where operator expected at (eval 6) line 5, near "n
"$LEVEL""
(Do you need to predeclare n?)
Bareword found where operator expected at (eval 6) line 6, near "then
log_rule_limit"
(Do you need to predeclare then?)
Bareword found where operator expected at (eval 6) line 6, near "$CHAIN
Knock"
(Missing operator before Knock?)
Bareword found where operator expected at (eval 6) line 6, near "$1
ACCEPT"
(Missing operator before ACCEPT?)
String found where operator expected at (eval 6) line 6, near "ACCEPT
"""
(Do you need to predeclare ACCEPT?)
String found where operator expected at (eval 6) line 6, near """
"Knock-$1""
(Missing operator before "Knock-$1"?)
Unquoted string "tcp" may clash with future reserved word at (eval 6)
line 6, <$currentfile> line 34.
Bareword found where operator expected at (eval 6) line 6, near
"--dport"
(Missing operator before dport?)
Use of /c modifier is meaningless without /g at (eval 6) line 6,
<$currentfile> line 34.
Bareword found where operator expected at (eval 6) line 6, near "m
recent --rcheck"
(Do you need to predeclare m?)
Bareword found where operator expected at (eval 6) line 6, near
"--name"
(Missing operator before name?)
Bareword found where operator expected at (eval 6) line 7, near "$1
log_rule_limit"
(Missing operator before log_rule_limit?)
Bareword found where operator expected at (eval 6) line 7, near "$CHAIN
Knock"
(Missing operator before Knock?)
Bareword found where operator expected at (eval 6) line 7, near "$1
DROP"
(Missing operator before DROP?)
String found where operator expected at (eval 6) line 7, near "DROP
"""
(Do you need to predeclare DROP?)
String found where operator expected at (eval 6) line 7, near """
"Knock-$1""
(Missing operator before "Knock-$1"?)
Unquoted string "tcp" may clash with future reserved word at (eval 6)
line 7, <$currentfile> line 34.
Bareword found where operator expected at (eval 6) line 7, near
"--dport"
(Missing operator before dport?)
Bareword found where operator expected at (eval 6) line 8, near "$1
fi"
(Missing operator before fi?)
Unquoted string "tcp" may clash with future reserved word at (eval 6)
line 9, <$currentfile> line 34.
Bareword found where operator expected at (eval 6) line 9, near
"--dport"
(Missing operator before dport?)
Use of /c modifier is meaningless without /g at (eval 6) line 9,
<$currentfile> line 34.
Bareword found where operator expected at (eval 6) line 9, near "m
recent --rcheck"
(Do you need to predeclare m?)
Bareword found where operator expected at (eval 6) line 9, near
"--seconds"
(Missing operator before seconds?)
Unquoted string "tcp" may clash with future reserved word at (eval 6)
line 10, <$currentfile> line 34.
Bareword found where operator expected at (eval 6) line 10, near
"--dport"
------------------------------------------
--
Levente "Si vis pacem para bellum!"
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/