From 5fc72fc7278bca2c6a94eaca95e40d38c2e84c82 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 31 Jan 2011 06:56:38 -0800 Subject: [PATCH] Ensure that accounting and manual chains aren't too long --- Shorewall/Perl/Shorewall/Chains.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index f6e2901ca..5e7f1938c 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -1257,6 +1257,7 @@ sub ensure_accounting_chain( $$ ) if ( $chainref ) { fatal_error "Non-accounting chain ($chain) used in an accounting rule" unless $chainref->{accounting}; } else { + fatal_error "Chain name ($chain) too long" if length $chain > 29; $chainref = new_chain 'filter' , $chain; $chainref->{accounting} = 1; $chainref->{referenced} = 1; @@ -1344,6 +1345,7 @@ sub new_nat_chain($) { sub new_manual_chain($) { my $chain = $_[0]; + fatal_error "Chain name ($chain) too long" if length $chain > 29; fatal_error "Duplicate Chain Name ($chain)" if $targets{$chain} || $filter_table->{$chain}; $targets{$chain} = CHAIN; ( my $chainref = ensure_filter_chain( $chain, 0) )->{manual} = 1;