diff -Nur --no-dereference smeserver-fail2ban-0.1.18.old/root/sbin/e-smith/smeserver-fail2ban smeserver-fail2ban-0.1.18/root/sbin/e-smith/smeserver-fail2ban --- smeserver-fail2ban-0.1.18.old/root/sbin/e-smith/smeserver-fail2ban 2017-10-27 08:34:58.000000000 -0400 +++ smeserver-fail2ban-0.1.18/root/sbin/e-smith/smeserver-fail2ban 2021-12-08 19:47:48.067000000 -0500 @@ -15,7 +15,7 @@ Usage: $0 --host= [--unban] [--protocol=tcp|udp|icmp|all] [--port=] [--bantime] - * --host must specify a valid IPv4 adress in the form 10.11.12.13 + * --host must specify a valid IPv4 adress in the form 10.11.12.13 or an IPv4 subnet in the form 10.11.12.0/24 * --protocol can be used to specify the protocol to block. Only tcp, udp, icmp and all are valid (default is all) * --port can be used to specify the port(s) to block. Only valid for tcp and udp. You can also specify a range of port like 10000:20000. You can also specify several ports or range of port separated by a comma @@ -91,9 +91,9 @@ usage() && die unless (defined $opts{$_}); } -# host must look like an IP address +# host must look like an IP address or IP with subnet usage() && die - unless ($opts{host} =~ m/^(?:(?:[01]?\d?\d?|2[0-4]\d|25[0-5])(?:\.|$)){4}$/); + unless ($opts{host} =~ m'^([01]?\d\d?|2[0-4]\d|25[0-5])(?:\.[01]?\d\d?|\.2[0-4]\d|\.25[0-5]){3}(?:/[0-2]\d|/3[0-2])?$'); # protocol must can only be undefined, tcp, udp or icmp usage() && die