[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bugs with fixes in Zmailer 2.99.15



zmailer 2.99.15, On Solaris 5.4, with native compiler:
========================================================================
PROBLEM: router/libdb/{un,}ordered.c:

"ordered.c", line 118: cannot do pointer arithmetic on operand of unknown size
cc: acomp failed for ordered.c
unordered.c:
"unordered.c", line 366: cannot do pointer arithmetic on operand of unknown 
size
"unordered.c", line 367: cannot do pointer arithmetic on operand of unknown 
size
cc: acomp failed for unordered.c

FIX: router/libdb/search.h: 27

-        void    *membuf;        /* MMAPed buffer start          */
+        char    *membuf;        /* MMAPed buffer start          */

NOTE: This is probably a bug in Solaris C compiler
=========================================================================
PROBLEM: transports/mailbox/mailbox.c:

On machines with [ug]id_t != short new mailboxes for users are created
owned by root:daemon rather than user:anything.

FIX:
--- mailbox.c.orig	Fri Aug 25 17:30:32 1995
+++ mailbox.c	Fri Sep  8 20:35:44 1995
@@ -214,7 +214,7 @@
 FILE *logfp;
 FILE *verboselog = NULL;
 int readalready = 0;		/* does buffer contain valid message data? */
-int currenteuid;		/* the current euid */
+uid_t currenteuid;		/* the current euid */
 extern int nobody;		/* safe uid for file/program delivery */
 int dobiff = 1;			/* enable biff notification */
 int dorbiff = 0;		/*    "   rbiff   " */
@@ -556,7 +556,8 @@
 	char *timestring;
 {
 	register char **maild;
-	int fdmail, uid, messagefd;
+	int fdmail, messagefd;
+	uid_t uid;
 	FILE *fp;
 	int hasdir;
 	struct stat st, s2;
@@ -575,7 +576,7 @@
 #endif
 
 	messagefd = dp->msgfd;
-	uid = atoi(rp->addr->misc);
+	uid = atol(rp->addr->misc);
 	at = strchr(rp->addr->user,'@');
 	switch (*(rp->addr->user)) {
 	case TO_PIPE:		/* pipe to program */
@@ -1162,7 +1163,9 @@
 	struct rcpt *rp;
 	char *timestring;
 {
-	int i, pid, uid, gid, in[2], out[2];
+	int i, pid, in[2], out[2];
+	uid_t uid;
+	gid_t gid;
 	char *env[20], buf[8192], *cp, *s;
 #ifdef	USE_UNIONWAIT
 	union wait status;
@@ -1184,7 +1187,7 @@
 	  env[i++] = cp;
 	  cp += strlen(cp) + 1;
 	}
-	uid = atoi(rp->addr->misc);
+	uid = atol(rp->addr->misc);
 	if ((pw = getpwuid(uid)) == NULL) {
 	  gid = 0;
 	  env[i++] = "HOME=/tmp";
@@ -1201,7 +1204,7 @@
 	sprintf(cp, "SENDER=%s", rp->addr->link->user);
 	env[i++] = cp;
 	cp += strlen(cp) + 1;
-	sprintf(cp, "UID=%d", uid);
+	sprintf(cp, "UID=%d", (int)uid);
 	env[i++] = cp;
 	if ((s = getzenv("ZCONFIG")) == NULL)
 	  s = ZMAILER_ENV_FILE;
@@ -1342,14 +1345,15 @@
 creatembox(rp, filep, uid, gid, pw)
 	struct rcpt *rp;
 	char **filep;
-	short *uid, *gid;
+	uid_t *uid;
+	gid_t *gid;
 	struct passwd *pw;
 {
 	char **maild;
 	int fd = -1;
 
-	*uid = (short)pw->pw_uid;
-	*gid = (short)pw->pw_gid;
+	*uid = pw->pw_uid;
+	*gid = pw->pw_gid;
 
 	for (maild = &maildirs[0]; *maild != 0; maild++) {
 	  if (*filep != NULL)
@@ -1399,7 +1403,7 @@
 createfile(rp, file, uid)
 	struct rcpt *rp;
 	char *file;
-	short uid;
+	uid_t uid;
 {
 	int fd, i = 0, saverrno;
 	struct stat st;
@@ -1463,23 +1467,23 @@
 int
 setupuidgid(rp, uid, gid)
 	struct rcpt *rp;
-	int uid;
-	int gid;
+	uid_t uid;
+	gid_t gid;
 {
 	setrootuid(rp);
 	if (setgid(gid) < 0) {
-	  DIAGNOSTIC(rp, EX_OSERR, "can't setgid to %d", gid);
+	  DIAGNOSTIC(rp, EX_OSERR, "can't setgid to %d", (int)gid);
 	  return 0;
 	}
 	if (*(rp->addr->user) == TO_FILE || *(rp->addr->user) == TO_PIPE)
-	  uid = atoi(rp->addr->misc);
+	  uid = atol(rp->addr->misc);
 	if (setreuid(-1, uid) < 0) {
-	  if (uid < 0 && atoi(rp->addr->misc) < 0) {
+	  if (uid < 0 && atol(rp->addr->misc) < 0) {
 	    /* use magic non-sense +ve uid < MAXSHORT */
 	    rp->addr->misc = NONUIDSTR;
-	    return setupuidgid(rp, atoi(NONUIDSTR), gid);
+	    return setupuidgid(rp, atol(NONUIDSTR), gid);
 	  }
-	  DIAGNOSTIC(rp, EX_OSERR, "can't seteuid to %d", uid);
+	  DIAGNOSTIC(rp, EX_OSERR, "can't seteuid to %d", (int)uid);
 	  return 0;
 	}
 	currenteuid = uid;

NOTE: I am not sure if this is clean for systems with uid_t == short,
      but I hope so.
===========================================================================

Hope this helps somebody...

Eugene