summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2004-11-05 12:33:59 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2004-11-05 12:33:59 +0000
commit926e1192c5762fc251a8f8e275f4a21119cea050 (patch)
tree6692015e13afe634e25ce8f3b9604a16f45b2f82
parent4deaf07d6cdd04468e4bc383945b9e19d7d55aa3 (diff)
If FIXED_NEVER_USERS was defined but empty, Exim erroneously assumed it
contained uid 0.
-rw-r--r--doc/doc-txt/ChangeLog5
-rw-r--r--src/src/EDITME5
-rw-r--r--src/src/buildconfig.c26
3 files changed, 22 insertions, 14 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 01bfcf8f1..d44ebae84 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -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
-------------------------------------------
@@ -59,6 +59,9 @@ Exim version 4.44
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
-----------------
diff --git a/src/src/EDITME b/src/src/EDITME
index 418b51bab..cea00d2c8 100644
--- a/src/src/EDITME
+++ b/src/src/EDITME
@@ -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 #
@@ -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
-# list is colon-separated.
+# list is colon-separated. It must NOT contain any spaces.
+# FIXED_NEVER_USERS=root:bin:daemon
FIXED_NEVER_USERS=root
diff --git a/src/src/buildconfig.c b/src/src/buildconfig.c
index f596ff827..6adb5d033 100644
--- a/src/src/buildconfig.c
+++ b/src/src/buildconfig.c
@@ -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 *
@@ -584,7 +584,7 @@ while (fgets(buffer, sizeof(buffer), base) != NULL)
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 @@ while (fgets(buffer, sizeof(buffer), base) != NULL)
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 @@ while (fgets(buffer, sizeof(buffer), base) != NULL)
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;
}