Displaying 2 results from an estimated 2 matches for "logprintf".
Did you mean:
log_printf
2004 Jul 15
3
slight simplification to firewall log_rule_limit code
...amp; rulenum=1
fi
case $level in
ULOG) log=ulog LOGTYPE=ULOG loglevel= ;;
*) log=log LOGTYPE=LOG loglevel="--log-level $level" ;;
esac
eval iptables -A $chain $@ $limit -j $LOGTYPE $LOGPARMS \
$loglevel \
--${log}-prefix ''"$(Logprintf "$LOGFORMAT" $chain $rulenum $disposition)"''
if [ $? -ne 0 ] ; then
[ -z "$stopping" ] && { stop_firewall; exit 2; }
fi
if [ -n "$LOGRULENUMBERS" ]; then
rulenum=$(($rulenum + 1))
eval ${chain}_logrules=$rulen...
2004 Jul 15
0
long rule action names with logging cause iptables errors
...mation.
Fixing this means checking the length of the expansion of the LOGFORMAT
variable after printf has had its way. Perhaps change this:
--log-prefix ''"$(printf "$LOGFORMAT" $chain $rulenum $disposition)"''
to this:
--log-prefix ''"$(Logprintf "$LOGFORMAT" $chain $rulenum $disposition)"''
Logprintf () {
fmt="$1"
shift
temp=$( printf "$fmt" $* )
if [ ${#temp} -gt 29 ]; then
save="$temp"
temp=$( expr "$temp" : ''\(.............................\)'...