[exim-cvs] cvs commit: exim/exim-src/src expand.c exim/exim…

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: exim-cvs
Assumpte: [exim-cvs] cvs commit: exim/exim-src/src expand.c exim/exim-test-orig/AutoTest/stdout 452
ph10 2005/12/14 14:50:12 GMT

  Modified files:
    exim-src/src         expand.c 
    exim-test-orig/AutoTest/stdout 452 
  Log:
  Fix bug in new code for more ACL variables - even before release!


  Revision  Changes    Path
  1.52      +11 -6     exim/exim-src/src/expand.c
  1.4       +1 -1      exim/exim-test-orig/AutoTest/stdout/452


  Index: expand.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/expand.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- expand.c    12 Dec 2005 15:58:53 -0000    1.51
  +++ expand.c    14 Dec 2005 14:50:12 -0000    1.52
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/expand.c,v 1.51 2005/12/12 15:58:53 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/expand.c,v 1.52 2005/12/14 14:50:12 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -1230,12 +1230,15 @@
   int last = var_table_size;


/* Handle ACL variables, which are not in the table because their number may
-vary depending on a build-time setting. */
+vary depending on a build-time setting. If the variable's name is not of the
+form acl_mddd or acl_cddd, where the d's are digits, fall through to look for
+other names that start with acl_. */

   if (Ustrncmp(name, "acl_", 4) == 0)
     {
  -  int offset, max, n;
     uschar *endptr;
  +  int offset = -1;
  +  int max = 0;


     if (name[4] == 'm')
       {
  @@ -1247,11 +1250,13 @@
       offset = 0;
       max = ACL_CVARS;
       }
  -  else return NULL;


  -  n = Ustrtoul(name + 5, &endptr, 10);
  -  if (*endptr != 0 || n >= max) return NULL;
  -  return (acl_var[offset + n] == NULL)? US"" : acl_var[offset + n];
  +  if (offset >= 0)
  +    {
  +    int n = Ustrtoul(name + 5, &endptr, 10);
  +    if (*endptr == 0 && n < max)
  +      return (acl_var[offset + n] == NULL)? US"" : acl_var[offset + n];
  +    }
     }


/* For all other variables, search the table */

  Index: 452
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stdout/452,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- 452    14 Nov 2005 15:29:11 -0000    1.3
  +++ 452    14 Dec 2005 14:50:12 -0000    1.4
  @@ -10,7 +10,7 @@
   ddddddddd 0
   -ident ph10
   -received_protocol local-smtp
  --acl 10 22
  +-aclm 0 22
   >Sender verify failed<
   -body_linecount 0
   -auth_id ph10