If FIXED_NEVER_USERS was defined but empty, Exim erroneously assumed it
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Fri, 5 Nov 2004 12:33:59 +0000 (12:33 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Fri, 5 Nov 2004 12:33:59 +0000 (12:33 +0000)
contained uid 0.

doc/doc-txt/ChangeLog
src/src/EDITME
src/src/buildconfig.c

index 01bfcf8f17dd288ab54e881c74f7166c9a5195d6..d44ebae844a146bb6727d23af8adc61b681777bb 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.15 2004/11/04 12:19:48 ph10 Exp $
+$Cambridge: 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
 -------------------------------------------
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -59,6 +59,9 @@ Exim version 4.44
 15. Added a new option "connect=<time>" to callout options, to set a different
     connection timeout.
 
 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
 -----------------
 
 Exim version 4.43
 -----------------
index 418b51bab541e63dee8713c595ab6715f1468fa8..cea00d2c841431c99c2b44b10289a23f77e06a20 100644 (file)
@@ -1,4 +1,4 @@
-# $Cambridge: exim/src/src/EDITME,v 1.3 2004/10/18 09:16:57 ph10 Exp $
+# $Cambridge: exim/src/src/EDITME,v 1.4 2004/11/05 12:33:59 ph10 Exp $
 
 ##################################################
 #          The Exim mail transport agent         #
 
 ##################################################
 #          The Exim mail transport agent         #
@@ -336,8 +336,9 @@ EXIM_MONITOR=eximon.bin
 # 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
 # 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
 
 
 FIXED_NEVER_USERS=root
 
 
index f596ff82727fbaf30663982bafe77b9361f615e8..6adb5d033fa014051258a97f5810b113205075f3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/buildconfig.c,v 1.2 2004/10/18 09:16:57 ph10 Exp $ */
+/* $Cambridge: exim/src/src/buildconfig.c,v 1.3 2004/11/05 12:33:59 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -584,7 +584,7 @@ while (fgets(buffer, sizeof(buffer), base) != NULL)
     else
       {
       int count = 1;
     else
       {
       int count = 1;
-      int i;
+      int i, j;
       uid_t *vector;
       char *p = list;
       while (*p != 0) if (*p++ == ':') count++;
       uid_t *vector;
       char *p = list;
       while (*p != 0) if (*p++ == ':') count++;
@@ -592,17 +592,22 @@ while (fgets(buffer, sizeof(buffer), base) != NULL)
       vector = malloc((count+1) * sizeof(uid_t));
       vector[0] = (uid_t)count;
 
       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];
         {
         char name[64];
+         
         p = list;
         while (*list != 0 && *list != ':') list++;
         strncpy(name, p, list-p);
         name[list-p] = 0;
         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
           {
           }
         else
           {
@@ -614,13 +619,12 @@ while (fgets(buffer, sizeof(buffer), base) != NULL)
               name);
             return 1;
             }
               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;
     }
       }
     continue;
     }