[exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog exim…

Góra strony
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Dla: exim-cvs
Temat: [exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog exim/exim-src/src EDITME buildconfig.c
ph10 2004/11/05 12:33:59 GMT

  Modified files:
    exim-doc/doc-txt     ChangeLog 
    exim-src/src         EDITME buildconfig.c 
  Log:
  If FIXED_NEVER_USERS was defined but empty, Exim erroneously assumed it
  contained uid 0.


  Revision  Changes    Path
  1.16      +3 -0      exim/exim-doc/doc-txt/ChangeLog
  1.4       +2 -1      exim/exim-src/src/EDITME
  1.3       +14 -10    exim/exim-src/src/buildconfig.c


  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ChangeLog    4 Nov 2004 12:19:48 -0000    1.15
  +++ ChangeLog    5 Nov 2004 12:33:59 -0000    1.16
  @@ -1,4 +1,4 @@
  -$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.15 2004/11/04 12:19:48 ph10 Exp $
  +$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.16 2004/11/05 12:33:59 ph10 Exp $


Change log file for Exim from version 4.21
-------------------------------------------
@@ -58,6 +58,9 @@

   15. Added a new option "connect=<time>" to callout options, to set a different
       connection timeout.
  +
  +16. If FIXED_NEVER_USERS was defined, but empty, Exim was assuming the uid 0
  +    was its contents. (It was OK if the option was not defined at all.)



Exim version 4.43

  Index: EDITME
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/EDITME,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EDITME    18 Oct 2004 09:16:57 -0000    1.3
  +++ EDITME    5 Nov 2004 12:33:59 -0000    1.4
  @@ -1,4 +1,4 @@
  -# $Cambridge: exim/exim-src/src/EDITME,v 1.3 2004/10/18 09:16:57 ph10 Exp $
  +# $Cambridge: exim/exim-src/src/EDITME,v 1.4 2004/11/05 12:33:59 ph10 Exp $


   ##################################################
   #          The Exim mail transport agent         #
  @@ -336,8 +336,9 @@
   # cannot be overridden at runtime. This guards against problems caused by
   # unauthorized changes to the runtime configuration. You are advised not to
   # remove "root" from this option, but you can add other users if you want. The
  -# list is colon-separated.
  +# list is colon-separated. It must NOT contain any spaces.


+# FIXED_NEVER_USERS=root:bin:daemon
FIXED_NEVER_USERS=root



  Index: buildconfig.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/buildconfig.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- buildconfig.c    18 Oct 2004 09:16:57 -0000    1.2
  +++ buildconfig.c    5 Nov 2004 12:33:59 -0000    1.3
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/buildconfig.c,v 1.2 2004/10/18 09:16:57 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/buildconfig.c,v 1.3 2004/11/05 12:33:59 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -584,7 +584,7 @@
       else
         {
         int count = 1;
  -      int i;
  +      int i, j;
         uid_t *vector;
         char *p = list;
         while (*p != 0) if (*p++ == ':') count++;
  @@ -592,17 +592,22 @@
         vector = malloc((count+1) * sizeof(uid_t));
         vector[0] = (uid_t)count;


  -      for (i = 1; i <= count; list++, i++)
  +      for (i = 1, j = 0; i <= count; list++, i++)
           {
           char name[64];
  +         
           p = list;
           while (*list != 0 && *list != ':') list++;
           strncpy(name, p, list-p);
           name[list-p] = 0;
  -
  -        if (name[strspn(name, "0123456789")] == 0)
  +        
  +        if (name[0] == 0)
  +          {
  +          continue; 
  +          }  
  +        else if (name[strspn(name, "0123456789")] == 0)
             {
  -          vector[i] = (uid_t)atoi(name);
  +          vector[j++] = (uid_t)atoi(name);
             }
           else
             {
  @@ -614,13 +619,12 @@
                 name);
               return 1;
               }
  -          vector[i] = pw->pw_uid;
  +          vector[j++] = pw->pw_uid;
             }
           }
  -      fprintf(new, "#define FIXED_NEVER_USERS     %d, ", count);
  -      for (i = 1; i <= count - 1; i++)
  -        fprintf(new, "%d, ", (unsigned int)vector[i]);
  -      fprintf(new, "%d\n", (unsigned int)vector[i]);
  +      fprintf(new, "#define FIXED_NEVER_USERS     %d", j);
  +      for (i = 0; i < j; i++) fprintf(new, ", %d", (unsigned int)vector[i]);
  +      fprintf(new, "\n");
         }
       continue;
       }