Fix backwards compatibility bug in named ACL variables.
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Tue, 24 Oct 2006 15:01:25 +0000 (15:01 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Tue, 24 Oct 2006 15:01:25 +0000 (15:01 +0000)
doc/doc-txt/ChangeLog
src/ACKNOWLEDGMENTS
src/src/spool_in.c

index e1fdcff03d81d70c993d16e6ddbce4d5bfe85687..f5ed7f48eece173709d21cffe103db49918cf6aa 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.415 2006/10/24 14:32:49 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.416 2006/10/24 15:01:25 ph10 Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -172,6 +172,9 @@ PH/27 In a string expansion for a processed (not raw) header when multiple
       from the last one. Now trailing whitespace is removed from each header
       before concatenation.
 
       from the last one. Now trailing whitespace is removed from each header
       before concatenation.
 
+PH/28 Fixed bug in backwards-compatibility feature of PH/09 (thanks to John
+      Jetmore). It would have mis-read ACL variables from pre-4.61 spool files.
+
 
 Exim version 4.63
 -----------------
 
 Exim version 4.63
 -----------------
index f20179edeaa37e10357dc5ffc4c418124710f29c..15827ea0c5871cec09e0e538512001ca0e6b5f22 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.60 2006/10/23 13:24:21 ph10 Exp $
+$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.61 2006/10/24 15:01:26 ph10 Exp $
 
 EXIM ACKNOWLEDGEMENTS
 
 
 EXIM ACKNOWLEDGEMENTS
 
@@ -20,7 +20,7 @@ relatively small patches.
 Philip Hazel
 
 Lists created: 20 November 2002
 Philip Hazel
 
 Lists created: 20 November 2002
-Last updated:  23 October 2006
+Last updated:  24 October 2006
 
 
 THE OLD LIST
 
 
 THE OLD LIST
@@ -168,7 +168,7 @@ Tom Hughes                Suggested patch for $n bug in pipe command from filter
 Pierre Humblet            Continued Cygwin support
 Peter Ilieve              Suggested patch for lookup search bug
 John Jetmore              Writing and maintaining the 'exipick' utility
 Pierre Humblet            Continued Cygwin support
 Peter Ilieve              Suggested patch for lookup search bug
 John Jetmore              Writing and maintaining the 'exipick' utility
-                          Much helpful testing of the test suite
+                          Much helpful testing of the test suite & elsewhere
                           Patch for -Mset
 Bob Johannessen           Patch for Sieve envelope tests bug
                           Patch for negative uid/gid bug
                           Patch for -Mset
 Bob Johannessen           Patch for Sieve envelope tests bug
                           Patch for negative uid/gid bug
index e878b34eac6295d891d92f24cc55ff5bb429db99..a24079dc4ee0b8a13e5f0947feb8ccc1d59cd70e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/spool_in.c,v 1.17 2006/10/10 11:15:12 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spool_in.c,v 1.18 2006/10/24 15:01:26 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -436,11 +436,14 @@ for (;;)
     else if (Ustrncmp(p, "cl ", 3) == 0)
       {
       int index, count;
     else if (Ustrncmp(p, "cl ", 3) == 0)
       {
       int index, count;
-      uschar name[4];
+      uschar name[20];   /* Need plenty of space for %d format */
       tree_node *node;
       if (sscanf(CS big_buffer + 5, "%d %d", &index, &count) != 2)
         goto SPOOL_FORMAT_ERROR;
       tree_node *node;
       if (sscanf(CS big_buffer + 5, "%d %d", &index, &count) != 2)
         goto SPOOL_FORMAT_ERROR;
-      (void) string_format(name, 4, "%c%d", (index < 10 ? 'c' : 'm'), index);
+      if (index < 10)
+        (void) string_format(name, sizeof(name), "%c%d", 'c', index);
+      else if (index < 20) /* ignore out-of-range index */
+        (void) string_format(name, sizeof(name), "%c%d", 'm', index - 10);
       node = acl_var_create(name);
       node->data.ptr = store_get(count + 1);
       if (fread(node->data.ptr, 1, count+1, f) < count) goto SPOOL_READ_ERROR;
       node = acl_var_create(name);
       node->data.ptr = store_get(count + 1);
       if (fread(node->data.ptr, 1, count+1, f) < count) goto SPOOL_READ_ERROR;