Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/gnu/dist/sendmail/sendmail Pull up revisions 1.5-1.6 (r...



details:   https://anonhg.NetBSD.org/src/rev/5d63131fb172
branches:  netbsd-1-5
changeset: 490797:5d63131fb172
user:      he <he%NetBSD.org@localhost>
date:      Fri Mar 09 17:50:25 2001 +0000

description:
Pull up revisions 1.5-1.6 (requested by itojun):
  Upgrade to sendmail 8.11.3.

diffstat:

 gnu/dist/sendmail/sendmail/recipient.c |  31 ++++++++++-
 gnu/dist/sendmail/sendmail/util.c      |  91 +++++++++++++++++++++++++--------
 2 files changed, 95 insertions(+), 27 deletions(-)

diffs (truncated from 316 to 300 lines):

diff -r 75ba99b4cd18 -r 5d63131fb172 gnu/dist/sendmail/sendmail/recipient.c
--- a/gnu/dist/sendmail/sendmail/recipient.c    Fri Mar 09 17:50:23 2001 +0000
+++ b/gnu/dist/sendmail/sendmail/recipient.c    Fri Mar 09 17:50:25 2001 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
  *     All rights reserved.
  * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
  * Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
  */
 
 #ifndef lint
-static char id[] = "@(#)Id: recipient.c,v 8.231.14.5 2000/06/27 20:15:46 gshapiro Exp";
+static char id[] = "@(#)Id: recipient.c,v 8.231.14.10 2001/02/14 04:07:30 gshapiro Exp";
 #endif /* ! lint */
 
 #include <sendmail.h>
@@ -718,7 +718,9 @@
                                (void) strlcpy(buf, pw->pw_name, buflen);
                                goto trylocaluser;
                        }
-                       if (strcmp(pw->pw_dir, "/") == 0)
+                       if (*pw->pw_dir == '\0')
+                               a->q_home = NULL;
+                       else if (strcmp(pw->pw_dir, "/") == 0)
                                a->q_home = "";
                        else
                                a->q_home = newstr(pw->pw_dir);
@@ -1134,6 +1136,23 @@
                dprintf("include: old uid = %d/%d\n",
                        (int) getuid(), (int) geteuid());
 
+#if _FFR_UNSAFE_WRITABLE_INCLUDE
+       if (forwarding)
+       {
+               if (!bitnset(DBS_GROUPWRITABLEFORWARDFILE, DontBlameSendmail))
+                       sfflags |= SFF_NOGWFILES;
+               if (!bitnset(DBS_WORLDWRITABLEFORWARDFILE, DontBlameSendmail))
+                       sfflags |= SFF_NOWWFILES;
+       }
+       else
+       {
+               if (!bitnset(DBS_GROUPWRITABLEINCLUDEFILE, DontBlameSendmail))
+                       sfflags |= SFF_NOGWFILES;
+               if (!bitnset(DBS_WORLDWRITABLEINCLUDEFILE, DontBlameSendmail))
+                       sfflags |= SFF_NOWWFILES;
+       }
+#endif /* _FFR_UNSAFE_WRITABLE_INCLUDE */
+
        if (forwarding)
                sfflags |= SFF_MUSTOWN|SFF_ROOTOK|SFF_NOWLINK;
 
@@ -1497,7 +1516,11 @@
                            isascii(p[-1]) && isspace(p[-1]) &&
                            (p[3] == '\0' || (isascii(p[3]) && isspace(p[3]))))
                        {
-                               p[-1] = '\0';
+                               --p;
+                               while (p > buf && isascii(p[-1]) &&
+                                      isspace(p[-1]))
+                                       --p;
+                               p[0] = '\0';
                                break;
                        }
                }
diff -r 75ba99b4cd18 -r 5d63131fb172 gnu/dist/sendmail/sendmail/util.c
--- a/gnu/dist/sendmail/sendmail/util.c Fri Mar 09 17:50:23 2001 +0000
+++ b/gnu/dist/sendmail/sendmail/util.c Fri Mar 09 17:50:25 2001 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
  *     All rights reserved.
  * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
  * Copyright (c) 1988, 1993
@@ -12,7 +12,7 @@
  */
 
 #ifndef lint
-static char id[] = "@(#)Id: util.c,v 8.225.2.1.2.8 2000/07/03 18:28:56 geir Exp";
+static char id[] = "@(#)Id: util.c,v 8.225.2.1.2.19 2001/02/22 18:56:24 gshapiro Exp";
 #endif /* ! lint */
 
 #include <sendmail.h>
@@ -209,6 +209,7 @@
        **  If have to rebalance an already short enough string,
        **  need to do it within allocated space.
        */
+
        slen = strlen(string);
        if (length == 0 || slen < length)
                length = slen;
@@ -496,14 +497,18 @@
        pidf = safefopen(pidpath, O_WRONLY|O_TRUNC, 0644, sff);
        if (pidf == NULL)
        {
-               sm_syslog(LOG_ERR, NOQID, "unable to write %s", pidpath);
+               sm_syslog(LOG_ERR, NOQID, "unable to write %s: %s",
+                         pidpath, errstring(errno));
        }
        else
        {
+               long pid;
                extern char *CommandLineArgs;
 
+               pid = (long) getpid();
+
                /* write the process id on line 1 */
-               fprintf(pidf, "%ld\n", (long) getpid());
+               fprintf(pidf, "%ld\n", pid);
 
                /* line 2 contains all command line flags */
                fprintf(pidf, "%s\n", CommandLineArgs);
@@ -640,7 +645,7 @@
                                if (strchr("=~&?", *s) != NULL)
                                        (void) putchar(*s++);
                                if (bitset(0200, *s))
-                                       printf("{%s}", macname(*s++ & 0377));
+                                       printf("{%s}", macname(bitidx(*s++)));
                                else
                                        printf("%c", *s++);
                                continue;
@@ -918,6 +923,11 @@
                        {
                                if (putc('.', mci->mci_out) == EOF)
                                        dead = TRUE;
+                               else
+                               {
+                                       /* record progress for DATA timeout */
+                                       DataProgress = TRUE;
+                               }
                                if (TrafficLogFile != NULL)
                                        (void) putc('.', TrafficLogFile);
                        }
@@ -928,6 +938,11 @@
                        {
                                if (putc('>', mci->mci_out) == EOF)
                                        dead = TRUE;
+                               else
+                               {
+                                       /* record progress for DATA timeout */
+                                       DataProgress = TRUE;
+                               }
                                if (TrafficLogFile != NULL)
                                        (void) putc('>', TrafficLogFile);
                        }
@@ -942,9 +957,11 @@
                                        dead = TRUE;
                                        break;
                                }
-
-                               /* record progress for DATA timeout */
-                               DataProgress = TRUE;
+                               else
+                               {
+                                       /* record progress for DATA timeout */
+                                       DataProgress = TRUE;
+                               }
                        }
                        if (dead)
                                break;
@@ -957,10 +974,11 @@
                                dead = TRUE;
                                break;
                        }
-
-                       /* record progress for DATA timeout */
-                       DataProgress = TRUE;
-
+                       else
+                       {
+                               /* record progress for DATA timeout */
+                               DataProgress = TRUE;
+                       }
                        if (TrafficLogFile != NULL)
                        {
                                for (l = l_base; l < q; l++)
@@ -981,6 +999,11 @@
                {
                        if (putc('.', mci->mci_out) == EOF)
                                break;
+                       else
+                       {
+                               /* record progress for DATA timeout */
+                               DataProgress = TRUE;
+                       }
                        if (TrafficLogFile != NULL)
                                (void) putc('.', TrafficLogFile);
                }
@@ -991,6 +1014,11 @@
                {
                        if (putc('>', mci->mci_out) == EOF)
                                break;
+                       else
+                       {
+                               /* record progress for DATA timeout */
+                               DataProgress = TRUE;
+                       }
                        if (TrafficLogFile != NULL)
                                (void) putc('>', TrafficLogFile);
                }
@@ -1003,9 +1031,11 @@
                                dead = TRUE;
                                break;
                        }
-
-                       /* record progress for DATA timeout */
-                       DataProgress = TRUE;
+                       else
+                       {
+                               /* record progress for DATA timeout */
+                               DataProgress = TRUE;
+                       }
                }
                if (dead)
                        break;
@@ -1014,6 +1044,11 @@
                        (void) putc('\n', TrafficLogFile);
                if (fputs(mci->mci_mailer->m_eol, mci->mci_out) == EOF)
                        break;
+               else
+               {
+                       /* record progress for DATA timeout */
+                       DataProgress = TRUE;
+               }
                if (l < end && *l == '\n')
                {
                        if (*++l != ' ' && *l != '\t' && *l != '\0' &&
@@ -1021,13 +1056,15 @@
                        {
                                if (putc(' ', mci->mci_out) == EOF)
                                        break;
+                               else
+                               {
+                                       /* record progress for DATA timeout */
+                                       DataProgress = TRUE;
+                               }
                                if (TrafficLogFile != NULL)
                                        (void) putc(' ', TrafficLogFile);
                        }
                }
-
-               /* record progress for DATA timeout */
-               DataProgress = TRUE;
        } while (l < end);
 }
 /*
@@ -1347,8 +1384,10 @@
        int i;
 
        for (i = BITMAPBYTES / sizeof (int); --i >= 0; )
+       {
                if ((a[i] & b[i]) != 0)
                        return TRUE;
+       }
        return FALSE;
 }
 /*
@@ -1372,8 +1411,10 @@
        int i;
 
        for (i = BITMAPBYTES / sizeof (int); --i >= 0; )
+       {
                if (map[i] != 0)
                        return FALSE;
+       }
        return TRUE;
 }
 /*
@@ -1485,8 +1526,8 @@
        static BITMAP256 baseline;
        extern int DtableSize;
 
-       if (DtableSize > 256)
-               maxfd = 256;
+       if (DtableSize > BITMAPBITS)
+               maxfd = BITMAPBITS;
        else
                maxfd = DtableSize;
        if (where == NULL)
@@ -1745,10 +1786,10 @@
 **             host -- the host to shorten (stripped in place).
 **
 **     Returns:
-**             none.
+**             place where string was trunacted, NULL if not truncated.
 */
 
-void
+char *
 shorten_hostname(host)
        char host[];
 {
@@ -1768,7 +1809,7 @@
        /* see if there is any domain at all -- if not, we are done */
        p = strchr(host, '.');
        if (p == NULL)
-               return;



Home | Main Index | Thread Index | Old Index