From: Philip Hazel Date: Mon, 23 Oct 2006 10:55:10 +0000 (+0000) Subject: Fix crash for verify=helo when no IP address (-bs). X-Git-Tag: exim-4_64~55 X-Git-Url: https://vcs.fsf.org/?p=exim.git;a=commitdiff_plain;h=d1d5595ca2487d927c857a01dcbfe0beab5c8f3d Fix crash for verify=helo when no IP address (-bs). --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 6059f6b6f..06a18dc3f 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.411 2006/10/18 08:55:37 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.412 2006/10/23 10:55:10 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -158,6 +158,10 @@ PH/22 As suggested by Dennis Davis, added a server_condition option to *all* PH/23 Testing for tls_required and lost_connection in a retry rule didn't work if any retry times were supplied. +PH/24 Exim crashed if verify=helo was activated during an incoming -bs + connection, where there is no client IP address to check. In this + situation, the verify now always succeeds. + Exim version 4.63 ----------------- diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index a87b65221..c75b2b207 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/smtp_in.c,v 1.45 2006/10/09 14:36:25 ph10 Exp $ */ +/* $Cambridge: exim/src/src/smtp_in.c,v 1.46 2006/10/23 10:55:10 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -2054,6 +2054,16 @@ if (sender_helo_name == NULL) HDEBUG(D_receive) debug_printf("no EHLO/HELO command was issued\n"); } +/* Deal with the case of -bs without an IP address */ + +else if (sender_host_address == NULL) + { + HDEBUG(D_receive) debug_printf("no client IP address: assume success\n"); + helo_verified = TRUE; + } + +/* Deal with the more common case when there is a sending IP address */ + else if (sender_helo_name[0] == '[') { helo_verified = Ustrncmp(sender_helo_name+1, sender_host_address, @@ -2139,7 +2149,7 @@ else } } -if (!helo_verified) helo_verify_failed = FALSE; /* We've tried ... */ +if (!helo_verified) helo_verify_failed = TRUE; /* We've tried ... */ return yield; } diff --git a/test/confs/0541 b/test/confs/0541 new file mode 100644 index 000000000..0b3be92bf --- /dev/null +++ b/test/confs/0541 @@ -0,0 +1,25 @@ +# Exim test configuration 0541 + +exim_path = EXIM_PATH +host_lookup_order = bydns +primary_hostname = myhost.test.ex +rfc1413_query_timeout = 0s +spool_directory = DIR/spool +log_file_path = DIR/spool/log/%slog +gecos_pattern = "" +gecos_name = CALLER_NAME + +# ----- Main settings ----- + +acl_smtp_helo = check_helo + + +# ----- ACLs ----- + +begin acl + +check_helo: + require verify = helo + accept + +# End diff --git a/test/scripts/0000-Basic/0541 b/test/scripts/0000-Basic/0541 new file mode 100644 index 000000000..0452c55c7 --- /dev/null +++ b/test/scripts/0000-Basic/0541 @@ -0,0 +1,5 @@ +# verify=helo with no IP address +exim -bs +helo a.b.c.d +quit +**** diff --git a/test/stdout/0541 b/test/stdout/0541 new file mode 100644 index 000000000..4037cb46a --- /dev/null +++ b/test/stdout/0541 @@ -0,0 +1,3 @@ +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250 myhost.test.ex Hello CALLER at a.b.c.d +221 myhost.test.ex closing connection