forked from extern/shorewall_code
Catch unprintable junk in config files
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@8150 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
52f29cad4b
commit
7a82ff8bba
@ -1187,7 +1187,11 @@ sub read_a_line() {
|
|||||||
#
|
#
|
||||||
$currentline = '', $currentlinenumber = 0, next if $currentline =~ /^\s*$/;
|
$currentline = '', $currentlinenumber = 0, next if $currentline =~ /^\s*$/;
|
||||||
#
|
#
|
||||||
# Line not blank -- Handle any first-entry message/capabilities check
|
# Line not blank -- Check for junk on the line
|
||||||
|
#
|
||||||
|
fatal_error "Non-ASCII gunk in file" if $currentline =~ /[^\s[:print:]]/;
|
||||||
|
#
|
||||||
|
# Handle any first-entry message/capabilities check
|
||||||
#
|
#
|
||||||
if ( $first_entry ) {
|
if ( $first_entry ) {
|
||||||
reftype( $first_entry ) ? $first_entry->() : progress_message2( $first_entry );
|
reftype( $first_entry ) ? $first_entry->() : progress_message2( $first_entry );
|
||||||
@ -1254,6 +1258,7 @@ sub read_a_line1() {
|
|||||||
chomp $currentline;
|
chomp $currentline;
|
||||||
next if $currentline =~ /^\s*$/;
|
next if $currentline =~ /^\s*$/;
|
||||||
$currentline =~ s/#.*$//; # Remove Trailing Comments
|
$currentline =~ s/#.*$//; # Remove Trailing Comments
|
||||||
|
fatal_error "Non-ASCII gunk in file" if $currentline =~ /[^\s[:print:]]/;
|
||||||
$currentlinenumber = $.;
|
$currentlinenumber = $.;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user