summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2005-04-07 10:10:01 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2005-04-07 10:10:01 +0000
commitebb6e6d5b13e114b1c101e6215ab84d995b5b12f (patch)
tree8a4962428b7f057bf9d9c4c9699f7995b55cbe97 /src
parent7fe1560fdef3119d3add60fc37b97ebb662144b4 (diff)
Change 4.50/80 broke the handling of negative uids and gids in spool
files. Negative gids are sometimes used. Allow for both to be negative.
Diffstat (limited to 'src')
-rw-r--r--src/ACKNOWLEDGMENTS3
-rw-r--r--src/src/spool_in.c13
2 files changed, 9 insertions, 7 deletions
diff --git a/src/ACKNOWLEDGMENTS b/src/ACKNOWLEDGMENTS
index e2ec4982c..8b7b704fb 100644
--- a/src/ACKNOWLEDGMENTS
+++ b/src/ACKNOWLEDGMENTS
@@ -1,4 +1,4 @@
-$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.21 2005/04/07 10:02:02 ph10 Exp $
+$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.22 2005/04/07 10:10:01 ph10 Exp $
EXIM ACKNOWLEDGEMENTS
@@ -154,6 +154,7 @@ Pierre Humblet Continued Cygwin support
Peter Ilieve Suggested patch for lookup search bug
John Jetmore Writing and maintaining the 'exipick' utility
Bob Johannessen Patch for Sieve envelope tests bug
+ Patch for negative uid/gid bug
Christian Kellner Patch for LDAP dereferencing
Alex Kiernan Patch for libradius
Diagnosis of milliwait clock-backwards bug
diff --git a/src/src/spool_in.c b/src/src/spool_in.c
index fb03d58b0..8deb73eb6 100644
--- a/src/src/spool_in.c
+++ b/src/src/spool_in.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/spool_in.c,v 1.9 2005/03/08 15:32:02 tom Exp $ */
+/* $Cambridge: exim/src/src/spool_in.c,v 1.10 2005/04/07 10:10:01 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -323,9 +323,10 @@ if (Ustrlen(big_buffer) != MESSAGE_ID_LENGTH + 3 ||
/* The next three lines in the header file are in a fixed format. The first
contains the login, uid, and gid of the user who caused the file to be written.
-The second contains the mail address of the message's sender, enclosed in <>.
-The third contains the time the message was received, and the number of warning
-messages for delivery delays that have been sent. */
+There are known cases where a negative gid is used, so we allow for both
+negative uids and gids. The second contains the mail address of the message's
+sender, enclosed in <>. The third contains the time the message was received,
+and the number of warning messages for delivery delays that have been sent. */
if (Ufgets(big_buffer, big_buffer_size, f) == NULL) goto SPOOL_READ_ERROR;
@@ -333,12 +334,12 @@ p = big_buffer + Ustrlen(big_buffer);
while (p > big_buffer && isspace(p[-1])) p--;
*p = 0;
if (!isdigit(p[-1])) goto SPOOL_FORMAT_ERROR;
-while (p > big_buffer && isdigit(p[-1])) p--;
+while (p > big_buffer && (isdigit(p[-1]) || '-' == p[-1])) p--;
gid = Uatoi(p);
if (p <= big_buffer || *(--p) != ' ') goto SPOOL_FORMAT_ERROR;
*p = 0;
if (!isdigit(p[-1])) goto SPOOL_FORMAT_ERROR;
-while (p > big_buffer && isdigit(p[-1])) p--;
+while (p > big_buffer && (isdigit(p[-1]) || '-' == p[-1])) p--;
uid = Uatoi(p);
if (p <= big_buffer || *(--p) != ' ') goto SPOOL_FORMAT_ERROR;
*p = 0;