On 1/31/11 9:27 AM, Steven Jan Springl wrote: > Use of uninitialized value $net in pattern match (m//) > at /usr/share/shorewall/Shorewall/Accounting.pm line 109, <$currentfile> line > 37.
The attached patch corrects that issue and tightens up the editing of ACCOUNT(...) in general. Thanks, Steven -Tom -- Tom Eastep \ When I die, I want to go like my Grandfather who Shoreline, \ died peacefully in his sleep. Not screaming like Washington, USA \ all of the passengers in his car http://shorewall.net \________________________________________________
diff --git a/Shorewall/Perl/Shorewall/Accounting.pm
b/Shorewall/Perl/Shorewall/Accounting.pm
index 960d42a..86a6e3a 100644
--- a/Shorewall/Perl/Shorewall/Accounting.pm
+++ b/Shorewall/Perl/Shorewall/Accounting.pm
@@ -103,11 +103,14 @@ sub process_accounting_rule( ) {
if ( $action eq 'DONE' ) {
$target = 'RETURN';
} elsif ( $action =~ /^ACCOUNT\((.+)\)$/ ) {
- my ( $table, $net ) = split/,/, $1;
require_capability 'ACCOUNT_TARGET' , 'ACCOUNT Rules' , '';
- fatal_error "Invalid or Missing Table Name ($table)" unless $table
=~ /^([-\w.]+)$/;
- fatal_error "Invalid Network Address" unless $net =~ '/(\d+)$';
- fatal_error "Netmask ($1) out of range" unless $1 >= 8;
+ my ( $table, $net, $rest ) = split/,/, $1;
+ fatal_error "Invalid Network Address (${net}${rest})" if defined
$rest;
+ fatal_error "Missing Table Name" unless defined $table
&& $table ne '';
+ fatal_error "Invalid Table Name ($table)" unless $table =~
/^([-\w.]+)$/;
+ fatal_error "Missing Network Address" unless defined $net;
+ fatal_error "Invalid Network Address ($net)" unless defined $net
&& $net =~ '/(\d+)$';
+ fatal_error "Netmask ($1) out of range" unless $1 >= 8;
validate_net $net, 0;
$target = "ACCOUNT --addr $net --tname $table";
} else {
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________ Shorewall-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shorewall-devel
