diff options
author | Gregory Neil Shapiro <gshapiro@FreeBSD.org> | 2023-01-15 19:15:36 +0000 |
---|---|---|
committer | Gregory Neil Shapiro <gshapiro@FreeBSD.org> | 2023-01-15 19:15:36 +0000 |
commit | 28fbd2825d216dafca4d991ad96d05b312f4f9a3 (patch) | |
tree | 8b322391c58a9bd5ad56827bbb8fcf4cbd114917 /contrib | |
parent | 0694dcb04b81dfbd70ffe7384816863170a48b3e (diff) | |
download | src-28fbd2825d216dafca4d991ad96d05b312f4f9a3.tar.gz src-28fbd2825d216dafca4d991ad96d05b312f4f9a3.zip |
Import sendmail 8.17.1vendor/sendmail/8.17.1
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/AuthRealm.p0 | 17 | ||||
-rwxr-xr-x | contrib/cidrexpand | 77 | ||||
-rwxr-xr-x[-rw-r--r--] | contrib/doublebounce.pl | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | contrib/link_hash.sh | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | contrib/re-mqueue.pl | 0 |
5 files changed, 79 insertions, 15 deletions
diff --git a/contrib/AuthRealm.p0 b/contrib/AuthRealm.p0 index 1ba8f58057fc..d1ac553df01f 100644 --- a/contrib/AuthRealm.p0 +++ b/contrib/AuthRealm.p0 @@ -1,19 +1,18 @@ Patch from John Marshall (slightly modified). +Modified for 8.16.1 by Anne Bennett. -diff --git a/sendmail/srvrsmtp.c b/sendmail/srvrsmtp.c -index 7dba983..bf804ab 100644 ---- a/sendmail/srvrsmtp.c -+++ b/sendmail/srvrsmtp.c -@@ -84,7 +84,7 @@ static int reset_saslconn __P((sasl_conn_t **_conn, char *_hostname, - # define RESET_SASLCONN \ +--- a/sendmail/srvrsmtp.c 2020-09-28 17:51:12.497535563 -0400 ++++ b/sendmail/srvrsmtp.c 2020-09-28 18:21:30.482890337 -0400 +@@ -116,7 +116,7 @@ do \ { \ + RESET_AUTH_FAIL_LOG_USER; \ - result = reset_saslconn(&conn, AuthRealm, remoteip, \ + result = reset_saslconn(&conn, hostname, remoteip, \ localip, auth_id, &ext_ssf); \ if (result != SASL_OK) \ sasl_ok = false; \ -@@ -938,8 +938,6 @@ smtp(nullserver, d_flags, e) +@@ -1018,8 +1018,6 @@ e->e_features = features; hostname = macvalue('j', e); #if SASL @@ -22,7 +21,7 @@ index 7dba983..bf804ab 100644 sasl_ok = bitset(SRV_OFFER_AUTH, features); n_mechs = 0; authenticating = SASL_NOT_AUTH; -@@ -948,8 +946,8 @@ smtp(nullserver, d_flags, e) +@@ -1028,8 +1026,8 @@ if (sasl_ok) { # if SASL >= 20000 @@ -33,7 +32,7 @@ index 7dba983..bf804ab 100644 # elif SASL > 10505 /* use empty realm: only works in SASL > 1.5.5 */ result = sasl_server_new("smtp", AuthRealm, "", NULL, 0, &conn); -@@ -5392,7 +5390,7 @@ reset_saslconn(sasl_conn_t **conn, char *hostname, +@@ -5559,7 +5557,7 @@ sasl_dispose(conn); # if SASL >= 20000 diff --git a/contrib/cidrexpand b/contrib/cidrexpand index ee24ee865275..d43b548ada81 100755 --- a/contrib/cidrexpand +++ b/contrib/cidrexpand @@ -3,7 +3,7 @@ # usage: # cidrexpand < /etc/mail/access | makemap -r hash /etc/mail/access # -# v 0.4 +# v 1.1 # # 17 July 2000 Derek J. Balling (dredd@megacity.org) # @@ -73,16 +73,25 @@ # Report bugs to: <dredd@megacity.org> # +our $VERSION = '1.1'; use strict; use Net::CIDR qw(cidr2octets cidrvalidate); use Getopt::Std; +$Getopt::Std::STANDARD_HELP_VERSION = 1; +sub VERSION_MESSAGE; +sub HELP_MESSAGE; sub print_expanded_v4network; sub print_expanded_v6network; our %opts; -getopts('ct:', \%opts); +getopts('cfhOSt:', \%opts); + +if ($opts{h}) { + HELP_MESSAGE(\*STDOUT); + exit 0; +} # Delimiter between the key and value my $space_re = exists $opts{t} ? $opts{t} : '\s+'; @@ -94,11 +103,13 @@ my $ipv4_re = qr"(?:\d+\.){3}\d+"; # Further checks are required for verifying that it's really one my $ipv6_re = qr"[0-9A-Fa-f:]{2,39}(?:\.\d+\.\d+\.\d+)?"; +my %pending; while (<>) { chomp; my ($prefix, $network, $len, $right); + next if /^#/ && $opts{S}; if ( (/\#/) && $opts{c} ) { # print "checking...\n"; @@ -129,12 +140,12 @@ while (<>) } if (($prefix, $network, $len, $right) = - m!^(|\S+:)(${ipv4_re})/(\d+)(${space_re}.*)$!) + m!^(|[^\s:]+:)(${ipv4_re})/(\d+)(${space_re}.*)$!) { print_expanded_v4network($network, $len, $prefix, $right); } elsif ((($prefix, $network, $len, $right) = - m!^((?:\S+:)?[Ii][Pp][Vv]6:)(${ipv6_re})(?:/(\d+))?(${space_re}.*)$!) && + m!^((?:[^\s:]+:)?[Ii][Pp][Vv]6:)(${ipv6_re})(?:/(\d+))?(${space_re}.*)$!) && (!defined($len) || $len <= 128) && defined(cidrvalidate($network))) { @@ -142,19 +153,31 @@ while (<>) } else { + if (%pending && m!^(.+?)${space_re}!) + { + delete $pending{$opts{f} ? $1 : lc($1)}; + } print "$_\n"; } } +print foreach values %pending; sub print_expanded_v4network { my ($network, $len, $prefix, $suffix) = @_; + my $fp = $opts{f} ? $prefix : lc($prefix); # cidr2octets() doesn't handle a prefix-length of zero, so do # that ourselves foreach my $nl ($len == 0 ? (0..255) : cidr2octets("$network/$len")) { - print "$prefix$nl$suffix\n"; + my $val = "$prefix$nl$suffix\n"; + if ($opts{O}) + { + $pending{"$fp$nl"} = $val; + next; + } + print $val; } } @@ -171,11 +194,53 @@ sub print_expanded_v6network } else { + my $fp = $opts{f} ? $prefix : lc($prefix); foreach my $nl (cidr2octets("$network/$len")) { # trim leading zeros from each group $nl =~ s/(^|:)0+(?=[^:])/$1/g; - print "$prefix$nl$suffix\n"; + my $val = "$prefix$nl$suffix\n"; + if ($opts{O}) + { + $pending{"$fp$nl"} = $val; + next; + } + print $val; } } } + +sub VERSION_MESSAGE +{ + my ($fh) = @_; + print $fh "cidrexpand - Version $VERSION\n"; +} + +sub HELP_MESSAGE +{ + my ($fh) = @_; + print $fh <<'EOF'; +Usage: cidrexpand [-cfhOS] [-t regexp] files... + +Expand CIDR format inside the keys of map entries for makemap. + + -c Truncate lines at the first unquoted '#' + + -f Treat keys as case-sensitive when doing override detection + for the -O option. By default overlap detection is + case-insensitive. + + -h Print this usage + + -O When a CIDR expansion would generate a partial conflict + with a later entry, suppress the overlap from the earlier + expansion + + -S Skip lines that start with '#' + + -t regexp + Use 'regexp' to match the delimiter between key and value, + defaulting to \s+ + +EOF +} diff --git a/contrib/doublebounce.pl b/contrib/doublebounce.pl index dc26ab84f1a7..dc26ab84f1a7 100644..100755 --- a/contrib/doublebounce.pl +++ b/contrib/doublebounce.pl diff --git a/contrib/link_hash.sh b/contrib/link_hash.sh index 7948f69d3a36..7948f69d3a36 100644..100755 --- a/contrib/link_hash.sh +++ b/contrib/link_hash.sh diff --git a/contrib/re-mqueue.pl b/contrib/re-mqueue.pl index 9f8d819eb18c..9f8d819eb18c 100644..100755 --- a/contrib/re-mqueue.pl +++ b/contrib/re-mqueue.pl |