diff --git a/Shorewall/functions b/Shorewall/functions index 83c0b096b..5bc7f263d 100755 --- a/Shorewall/functions +++ b/Shorewall/functions @@ -185,13 +185,17 @@ mutex_off() # Read a file and handle "INCLUDE" directives # -read_file() # $1 = file name +read_file() # $1 = file name, $2 = nest count { local first rest while read first rest; do if [ "x$first" = "xINCLUDE" ]; then - read_file `find_file ${rest%#*}` + if [ $2 -lt 4 ]; then + read_file `find_file ${rest%#*}` $(($count + 1)) + else + echo " WARNING: INCLUDE in $1 ignored (nested too deeply)" >&2 + fi else echo "$first $rest" fi @@ -216,7 +220,7 @@ strip_file() # $1 = Base Name of the file, $2 = Full Name of File (optional) [ $# = 1 ] && fname=`find_file $1` || fname=$2 if [ -f $fname ]; then - read_file $fname | cut -d'#' -f1 | grep -v '^[[:space:]]*$' > $TMP_DIR/$1 + read_file $fname 0 | cut -d'#' -f1 | grep -v '^[[:space:]]*$' > $TMP_DIR/$1 else > $TMP_DIR/$1 fi diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index ce7d19885..03f09a940 100755 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -25,41 +25,44 @@ New Features: configuration directory if one has been specified for the command. Examples: - shorewall/params.mgmt: - MGMT_SERVERS=1.1.1.1,2.2.2.2,3.3.3.3 - TIME_SERVERS=4.4.4.4 - BACKUP_SERVERS=5.5.5.5 - ----- end params.mgmt ----- + shorewall/params.mgmt: + MGMT_SERVERS=1.1.1.1,2.2.2.2,3.3.3.3 + TIME_SERVERS=4.4.4.4 + BACKUP_SERVERS=5.5.5.5 + ----- end params.mgmt ----- - shorewall/params: - # Shorewall 1.3 /etc/shorewall/params - [..] - ####################################### + shorewall/params: + # Shorewall 1.3 /etc/shorewall/params + [..] + ####################################### - INCLUDE params.mgmt + INCLUDE params.mgmt - # params unique to this host here - #LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE - ----- end params ----- + # params unique to this host here + #LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE + ----- end params ----- - shorewall/rules.mgmt: - ACCEPT net:$MGMT_SERVERS $FW tcp 22 - ACCEPT $FW net:$TIME_SERVERS udp 123 - ACCEPT $FW net:$BACKUP_SERVERS tcp 22 - ----- end rules.mgmt ----- + shorewall/rules.mgmt: + ACCEPT net:$MGMT_SERVERS $FW tcp 22 + ACCEPT $FW net:$TIME_SERVERS udp 123 + ACCEPT $FW net:$BACKUP_SERVERS tcp 22 + ----- end rules.mgmt ----- - shorewall/rules: - # Shorewall version 1.3 - Rules File - [..] - ####################################### + shorewall/rules: + # Shorewall version 1.3 - Rules File + [..] + ####################################### - INCLUDE rules.mgmt + INCLUDE rules.mgmt - # rules unique to this host here - #LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE - ----- end rules ----- + # rules unique to this host here + #LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE + ----- end rules ----- + + INCLUDE's may be nested to a level of 3 -- further nested INCLUDE + directives are ignored. + -