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