Fix Bugzilla #101: macro definition between ACLs doesn't work.
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Tue, 27 Jun 2006 15:07:18 +0000 (15:07 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Tue, 27 Jun 2006 15:07:18 +0000 (15:07 +0000)
doc/doc-txt/ChangeLog
src/src/acl.c
test/confs/0534 [new file with mode: 0644]
test/scripts/0000-Basic/0534 [new file with mode: 0644]
test/stderr/0534 [new file with mode: 0644]
test/stdout/0534 [new file with mode: 0644]

index 08c60a8c305d73093ba4cbe1a9fc86435f2fca92..9a2d9c83c1d71c0dd98b771c6532c140b82cf557 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.359 2006/06/27 14:34:26 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.360 2006/06/27 15:07:18 ph10 Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -43,6 +43,8 @@ PH/02 Add the verb name to the "unknown ACL verb" error.
 
 PH/03 Magnus Holmgren's patch for filter_prepend_home.
 
+PH/03 Fixed Bugzilla #101: macro definition between ACLs doesn't work.
+
 
 Exim version 4.62
 -----------------
index 033291b0cd864d37d232f37ee709907b1fbced96..02a2e94400e4d9ef7dc000a4d5124a31f6bda116 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/acl.c,v 1.60 2006/06/27 14:04:29 ph10 Exp $ */
+/* $Cambridge: exim/src/src/acl.c,v 1.61 2006/06/27 15:07:18 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -710,7 +710,7 @@ while ((s = (*func)()) != NULL)
   can be started by a name, or by a macro definition. */
 
   s = readconf_readname(name, sizeof(name), s);
-  if (*s == ':' || isupper(name[0] && *s == '=')) return yield;
+  if (*s == ':' || (isupper(name[0]) && *s == '=')) return yield;
 
   /* If a verb is unrecognized, it may be another condition or modifier that
   continues the previous verb. */
diff --git a/test/confs/0534 b/test/confs/0534
new file mode 100644 (file)
index 0000000..b148987
--- /dev/null
@@ -0,0 +1,30 @@
+# Exim test configuration 0534
+
+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_connect = two
+
+
+# ----- ACLs -----
+
+begin ACL
+
+one:
+  accept hosts = 1.2.3.4
+
+MACRO_DEFINITION=5.6.7.8
+
+two:
+  accept hosts = MACRO_DEFINITION
+
+
+# End
diff --git a/test/scripts/0000-Basic/0534 b/test/scripts/0000-Basic/0534
new file mode 100644 (file)
index 0000000..b1a992e
--- /dev/null
@@ -0,0 +1,4 @@
+# Macro definition between ACLs
+exim -bh 5.6.7.8
+quit
+****
diff --git a/test/stderr/0534 b/test/stderr/0534
new file mode 100644 (file)
index 0000000..d7fd3e1
--- /dev/null
@@ -0,0 +1,13 @@
+>>> host in hosts_connection_nolog? no (option unset)
+>>> host in host_lookup? no (option unset)
+>>> host in host_reject_connection? no (option unset)
+>>> host in sender_unqualified_hosts? no (option unset)
+>>> host in recipient_unqualified_hosts? no (option unset)
+>>> host in helo_verify_hosts? no (option unset)
+>>> host in helo_try_verify_hosts? no (option unset)
+>>> host in helo_accept_junk_hosts? no (option unset)
+>>> using ACL "two"
+>>> processing "accept"
+>>> check hosts = 5.6.7.8
+>>> host in "5.6.7.8"? yes (matched "5.6.7.8")
+>>> accept: condition test succeeded
diff --git a/test/stdout/0534 b/test/stdout/0534
new file mode 100644 (file)
index 0000000..1172c46
--- /dev/null
@@ -0,0 +1,7 @@
+
+**** SMTP testing session as if from host 5.6.7.8
+**** but without any ident (RFC 1413) callback.
+**** This is not for real!
+
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+221 myhost.test.ex closing connection\r