summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/contrib
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2006-08-17 05:10:43 +0000
committergshapiro <gshapiro@FreeBSD.org>2006-08-17 05:10:43 +0000
commit0a9c74f73599b0ca2981b57815b436d1f6de6191 (patch)
tree5f8206fabf17de836a5a6161ba1e0d5ff61638e4 /contrib/sendmail/contrib
parent1024e3943e17bd4407f0cf3a799cfa05d59f1059 (diff)
downloadFreeBSD-src-0a9c74f73599b0ca2981b57815b436d1f6de6191.zip
FreeBSD-src-0a9c74f73599b0ca2981b57815b436d1f6de6191.tar.gz
Import sendmail 8.13.8
Diffstat (limited to 'contrib/sendmail/contrib')
-rwxr-xr-xcontrib/sendmail/contrib/cidrexpand19
1 files changed, 13 insertions, 6 deletions
diff --git a/contrib/sendmail/contrib/cidrexpand b/contrib/sendmail/contrib/cidrexpand
index b7ace25..882534a 100755
--- a/contrib/sendmail/contrib/cidrexpand
+++ b/contrib/sendmail/contrib/cidrexpand
@@ -1,13 +1,13 @@
#!/usr/bin/perl -w
-# $Id: cidrexpand,v 8.4 2002/11/22 21:13:14 ca Exp $
+# $Id: cidrexpand,v 8.4.2.1 2006/08/07 17:22:10 ca Exp $
#
# v 0.4
#
# 17 July 2000 Derek J. Balling (dredd@megacity.org)
-#
+#
# Acts as a preparser on /etc/mail/access_db to allow you to use address/bit
-# notation.
+# notation.
#
# If you have two overlapping CIDR blocks with conflicting actions
# e.g. 10.2.3.128/25 REJECT and 10.2.3.143 ACCEPT
@@ -25,10 +25,15 @@
# Added code to deal with the prefix tags that may now be included in
# the access_db
#
-# Added clarification in the notes for what to do if you have
+# Added clarification in the notes for what to do if you have
# exceptions to a larger CIDR block.
#
-# usage:
+# 3 August 2006
+#
+# Corrected a bug to have it handle the special case of "0.0.0.0/0"
+# since Net::CIDR doesn't handle it properly.
+#
+# usage:
# cidrexpand < /etc/mail/access | makemap -r hash /etc/mail/access
#
#
@@ -72,7 +77,7 @@ while (<>)
}
}
}
-
+
sub expand_network
{
my $left_input = shift;
@@ -80,6 +85,8 @@ sub expand_network
my ($network,$mask) = split /\//, $left_input;
if (defined $mask)
{
+ return (0..255) if $mask == 0;
+
my @parts = split /\./, $network;
while ($#parts < 3)
{
OpenPOWER on IntegriCloud