diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index da7ac67eb..0b2efc7ae 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -6593,11 +6593,14 @@ sub get_configuration( $$$ ) { default_yes_no 'MANGLE_ENABLED' , have_capability( 'MANGLE_ENABLED' ) ? 'Yes' : ''; default_yes_no 'USE_DEFAULT_RT' , ''; default_yes_no 'RESTORE_DEFAULT_ROUTE' , 'Yes'; - default_yes_no 'AUTOMAKE' , '' unless ( $val = $config{AUTOMAKE} ) && $val =~ /^\d{1,2}$/; default_yes_no 'TRACK_PROVIDERS' , 'Yes'; default_yes_no 'BALANCE_PROVIDERS' , $config{USE_DEFAULT_RT} ? 'Yes' : ''; default_yes_no 'USE_NFLOG_SIZE' , ''; + if ( ( $val = $config{AUTOMAKE} ) !~ /^[Rr]ecursive$/ ) { + default_yes_no( 'AUTOMAKE' , '' ) unless $val && $val =~ /^\d{1,2}$/; + } + if ( $config{USE_NFLOG_SIZE} ) { if ( have_capability( 'NFLOG_SIZE' ) ) { @suffixes = qw(group size threshold nlgroup cprange qthreshold); diff --git a/Shorewall/lib.cli-std b/Shorewall/lib.cli-std index d4c598bce..8bbe80e3d 100644 --- a/Shorewall/lib.cli-std +++ b/Shorewall/lib.cli-std @@ -290,6 +290,9 @@ get_config() { ;; [1-9][0-9]) ;; + [Rr]ecursive) + AUTOMAKE=recursive + ;; *) if [ -n "$AUTOMAKE" ]; then fatal_error "Invalid AUTOMAKE setting ($AUTOMAKE)" @@ -402,7 +405,15 @@ uptodate() { # # Busybox 'find' doesn't support -quit. # - if [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print)" ]; then + if [ $AUTOMAKE = recursive ]; then + if [ -n "$(${find} ${dir} -newer $1 -print)" ]; then + return 1; + fi + elif [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print)" ]; then + return 1; + fi + elif [ $AUTOMAKE = recursive ]; then + if [ -n "$(${find} ${dir} -newer $1 -print -quit)" ]; then return 1; fi elif [ -n "$(${find} ${dir} -maxdepth $AUTOMAKE -type f -newer $1 -print -quit)" ]; then diff --git a/Shorewall/manpages/shorewall.conf.xml b/Shorewall/manpages/shorewall.conf.xml index ad729548f..2f2013266 100644 --- a/Shorewall/manpages/shorewall.conf.xml +++ b/Shorewall/manpages/shorewall.conf.xml @@ -464,7 +464,7 @@ AUTOMAKE=[Yes|No|depth] + role="bold">No||depth] If set, the behavior of the start, @@ -492,13 +492,17 @@ Prior to 5.1.10.2, a change to a file in or adding a file to /etc/shorewall/rules.d/loc/ would trigger recompilation. Beginning with 5.1.10.2, such changes would not trigger recompilation. - Beginning with Shorewall 5.2.0, AUTOMAKE may be set to a numeric - depth which specifies how deeply each - listed directory is to be searched. AUTOMAKE=1 only searches each - directory itself and is equivalent to AUTOMAKE=Yes. AUTOMAKE=2 will - search each directory and its immediate sub-directories; AUTOMAKE=3 - will search each diretory, each of its immediate sub-directories, - and each of their immediate sub-directories, etc. + Beginning with Shorewall 5.2.0, the pre-5.1.10.2 behavior can be + obtained by setting AUTOMAKE=recursive. + + Also beginning with Shorewall 5.2.0, AUTOMAKE may be set to a + numeric depth which specifies how deeply + each listed directory is to be searched. AUTOMAKE=1 only searches + each directory itself and is equivalent to AUTOMAKE=Yes. AUTOMAKE=2 + will search each directory and its immediate sub-directories; + AUTOMAKE=3 will search each diretory, each of its immediate + sub-directories, and each of their immediate sub-directories, + etc.