diff options
Diffstat (limited to 'usr.sbin/sendmail/src')
-rw-r--r-- | usr.sbin/sendmail/src/READ_ME | 49 | ||||
-rw-r--r-- | usr.sbin/sendmail/src/err.c | 6 | ||||
-rw-r--r-- | usr.sbin/sendmail/src/map.c | 156 | ||||
-rw-r--r-- | usr.sbin/sendmail/src/queue.c | 13 | ||||
-rw-r--r-- | usr.sbin/sendmail/src/version.c | 4 |
5 files changed, 147 insertions, 81 deletions
diff --git a/usr.sbin/sendmail/src/READ_ME b/usr.sbin/sendmail/src/READ_ME index 154916a..7eea267 100644 --- a/usr.sbin/sendmail/src/READ_ME +++ b/usr.sbin/sendmail/src/READ_ME @@ -30,7 +30,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# @(#)READ_ME 8.148 (Berkeley) 8/1/97 +# @(#)READ_ME 8.156 (Berkeley) 10/23/97 # This directory contains the source files for sendmail. @@ -148,9 +148,10 @@ The options are: NEWDB The new Berkeley DB package. Some systems (e.g., BSD/OS and Digital UNIX 4.0) have this package pre-installed. If your - system does not have NEWDB installed, get the latest version + system does not have NEWDB installed, get version 1.85 from http://www.sleepycat.com/packages/db.1.85.tar.gz. - DO NOT use the version from the Net2 distribution. If you are + DO NOT use Berkeley DB version 2.X with sendmail. DO NOT + use the version from the Net2 distribution. If you are still running BSD/386 1.x, you will also need to define OLD_NEWDB. NDBM The older NDBM implementation -- the very old V7 DBM @@ -731,7 +732,13 @@ SunOS 4.1.3, 4.1.3_U1 101790-01 (SunOS 4.1.3_U1: TCP socket and reset problems). Solaris 2.x (SunOS 5.x) - To compile for Solaris, be sure you use -DSOLARIS. + To compile for Solaris, the Makefile chosen by makesendmail must + include a SOLARIS definition which reflects the Solaris version + (i.e. -DSOLARIS=20400 for 2.4 or -DSOLARIS=20501 for 2.5.1). + If you are using gcc, make sure -I/usr/include is not used (or + it might complain about TopFrame). If you are using Sun's cc, + make sure /opt/SUNWspro/bin/cc is used instead of /usr/ucb/cc + (or it might complain about tm_zone). To the best of my knowledge, Solaris does not have the gethostbyname problem described above. However, it does @@ -828,22 +835,25 @@ Solaris 2.6 (SunOS 5.6) incompatible snprintf(3s) calls. This problem is fixed in sendmail 8.8.5. -Solaris 2.5.1 (SunOS 5.5.1) - Apparently patch 103663-01 installs a new /usr/include/resolv.h - file that defines the __P macro without checking to see if it is - already defined. This causes compile warnings such as: +Solaris 2.5.1 (SunOS 5.5.1) and 2.6 (SunOS 5.6) + Apparently Solaris 2.5.1 patch 103663-01 installs a new + /usr/include/resolv.h file that defines the __P macro without + checking to see if it is already defined. This new resolv.h is also + included in the Solaris 2.6 distribution. This causes compile + warnings such as: In file included from daemon.c:51: /usr/include/resolv.h:208: warning: `__P' redefined cdefs.h:58: warning: this is the location of the previous definition - If you are running with this patch, create a resolv.h file in the - obj.SunOS.5.5.1.* directory that reads: + These warnings can be safely ignored or you can create a resolv.h + file in the obj.SunOS.5.5.1.* or obj.SunOS.5.6.* directory that reads: #undef __P #include "/usr/include/resolv.h" - ... And then file a bug report with Sun. + Sun is aware of the problem (Sun bug ID 4081053) and it will be fixed + in a to-be-released patch. Ultrix By default, the IDENT protocol is turned off on Ultrix. If you @@ -852,7 +862,7 @@ Ultrix IDENT on in the configuration file by setting the "ident" timeout to 30 seconds. -OSF/1 +Digital UNIX (formerly DEC OSF/1) If you are compiling on OSF/1 (DEC Alpha), you must use -L/usr/shlib (otherwise it core dumps on startup). You may also need -mld to get the nlist() function, although some versions @@ -865,6 +875,19 @@ OSF/1 properly due to a bug in the getpw* routines. If you want to use this, use -DDEC_OSF_BROKEN_GETPWENT=1. The problem is fixed in 3.2C. + On Digital UNIX 4.0 and later, Berkeley DB is included with the + operating system and already has the ndbm.o module removed. However, + Digital has modified the original Berkeley DB db.h include file. + This results in the following warning while compiling map.c and udb.c: + + cc: Warning: /usr/include/db.h, line 74: The redefinition of the macro + "__signed" conflicts with a current definition because the replacement + lists differ. The redefinition is now in effect. + #define __signed signed + ------------------------^ + + This warning can be ignored. + IRIX The header files on SGI IRIX are completely prototyped, and as a result you can sometimes get some warning messages during @@ -1439,4 +1462,4 @@ version.c The version number and information about this Eric Allman -(Version 8.148, last update 8/1/97 16:41:54) +(Version 8.156, last update 10/23/97 12:53:12) diff --git a/usr.sbin/sendmail/src/err.c b/usr.sbin/sendmail/src/err.c index f4f95e6..f08d960 100644 --- a/usr.sbin/sendmail/src/err.c +++ b/usr.sbin/sendmail/src/err.c @@ -33,7 +33,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)err.c 8.64 (Berkeley) 7/25/97"; +static char sccsid[] = "@(#)err.c 8.65 (Berkeley) 10/18/97"; #endif /* not lint */ # include "sendmail.h" @@ -556,7 +556,9 @@ fmtmsg(eb, to, num, eno, fmt, ap) } /* output the "to" person */ - if (to != NULL && to[0] != '\0') + if (to != NULL && to[0] != '\0' && + strncmp(num, "551", 3) != 0 && + strncmp(num, "251", 3) != 0) { (void) snprintf(eb, spaceleft, "%s... ", shortenstring(to, 203)); diff --git a/usr.sbin/sendmail/src/map.c b/usr.sbin/sendmail/src/map.c index 88e82b1..e889736 100644 --- a/usr.sbin/sendmail/src/map.c +++ b/usr.sbin/sendmail/src/map.c @@ -33,7 +33,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)map.c 8.181 (Berkeley) 7/9/97"; +static char sccsid[] = "@(#)map.c 8.186 (Berkeley) 10/21/97"; #endif /* not lint */ #include "sendmail.h" @@ -402,8 +402,8 @@ map_rewrite(map, s, slen, av) ** ** Side Effects: ** initializes aliases: -** if NDBM: opens the database. -** if ~NDBM: reads the aliases into the symbol table. +** if alias database: opens the database. +** if no database available: reads aliases into the symbol table. */ void @@ -417,25 +417,20 @@ initmaps(rebuild, e) checkfd012("entering initmaps"); #endif CurEnv = e; - if (rebuild) - { - stabapply(map_init, 1); - stabapply(map_init, 2); - } - else - { - stabapply(map_init, 0); - } + + stabapply(map_init, 0); + stabapply(map_init, rebuild ? 2 : 1); #if XDEBUG checkfd012("exiting initmaps"); #endif } void -map_init(s, rebuild) +map_init(s, pass) register STAB *s; - int rebuild; + int pass; { + bool rebuildable; register MAP *map; /* has to be a map */ @@ -452,13 +447,23 @@ map_init(s, rebuild) map->map_class->map_cname, map->map_mname == NULL ? "NULL" : map->map_mname, map->map_file == NULL ? "NULL" : map->map_file, - rebuild); + pass); + + /* + ** Pass 0 opens all non-rebuildable maps. + ** Pass 1 opens all rebuildable maps for read. + ** Pass 2 rebuilds all rebuildable maps. + */ + + rebuildable = (bitset(MF_ALIAS, map->map_mflags) && + bitset(MCF_REBUILDABLE, map->map_class->map_cflags)); - if (rebuild == (bitset(MF_ALIAS, map->map_mflags) && - bitset(MCF_REBUILDABLE, map->map_class->map_cflags) ? 1 : 2)) + if ((pass == 0 && rebuildable) || + ((pass == 1 || pass == 2) && !rebuildable)) { if (tTd(38, 3)) - printf("\twrong pass\n"); + printf("\twrong pass (pass = %d, rebuildable = %d)\n", + pass, rebuildable); return; } @@ -468,43 +473,42 @@ map_init(s, rebuild) map->map_class->map_close(map); map->map_mflags &= ~(MF_OPEN|MF_WRITABLE); } - - if (rebuild == 2) + + if (pass == 2) { rebuildaliases(map, FALSE); + return; + } + + if (map->map_class->map_open(map, O_RDONLY)) + { + if (tTd(38, 4)) + printf("\t%s:%s %s: valid\n", + map->map_class->map_cname == NULL ? "NULL" : + map->map_class->map_cname, + map->map_mname == NULL ? "NULL" : + map->map_mname, + map->map_file == NULL ? "NULL" : + map->map_file); + map->map_mflags |= MF_OPEN; } else { - if (map->map_class->map_open(map, O_RDONLY)) - { - if (tTd(38, 4)) - printf("\t%s:%s %s: valid\n", - map->map_class->map_cname == NULL ? "NULL" : - map->map_class->map_cname, - map->map_mname == NULL ? "NULL" : - map->map_mname, - map->map_file == NULL ? "NULL" : - map->map_file); - map->map_mflags |= MF_OPEN; - } - else + if (tTd(38, 4)) + printf("\t%s:%s %s: invalid: %s\n", + map->map_class->map_cname == NULL ? "NULL" : + map->map_class->map_cname, + map->map_mname == NULL ? "NULL" : + map->map_mname, + map->map_file == NULL ? "NULL" : + map->map_file, + errstring(errno)); + if (!bitset(MF_OPTIONAL, map->map_mflags)) { - if (tTd(38, 4)) - printf("\t%s:%s %s: invalid: %s\n", - map->map_class->map_cname == NULL ? "NULL" : - map->map_class->map_cname, - map->map_mname == NULL ? "NULL" : - map->map_mname, - map->map_file == NULL ? "NULL" : - map->map_file, - errstring(errno)); - if (!bitset(MF_OPTIONAL, map->map_mflags)) - { - extern MAPCLASS BogusMapClass; + extern MAPCLASS BogusMapClass; - map->map_class = &BogusMapClass; - map->map_mflags |= MF_OPEN; - } + map->map_class = &BogusMapClass; + map->map_mflags |= MF_OPEN; } } } @@ -781,14 +785,6 @@ ndbm_map_open(map, mode) if (std.st_mode == ST_MODE_NOFILE) mode |= O_CREAT|O_EXCL; - /* heuristic: if files are linked, this is actually gdbm */ - if (std.st_dev == stp.st_dev && std.st_ino == stp.st_ino) - { - syserr("dbm map \"%s\": cannot support GDBM", - map->map_mname); - return FALSE; - } - #if LOCK_ON_OPEN if (mode == O_RDONLY) mode |= O_SHLOCK; @@ -891,6 +887,20 @@ ndbm_map_open(map, mode) } dfd = dbm_dirfno(dbm); pfd = dbm_pagfno(dbm); + if (dfd == pfd) + { + /* heuristic: if files are linked, this is actually gdbm */ + dbm_close(dbm); +#if !LOCK_ON_OPEN && !NOFTRUNCATE + if (map->map_lockfd >= 0) + close(map->map_lockfd); +#endif + errno = 0; + syserr("dbm map \"%s\": cannot support GDBM", + map->map_mname); + return FALSE; + } + if (filechanged(dirfile, dfd, &std, sff) || filechanged(pagfile, pfd, &stp, sff)) { @@ -944,6 +954,7 @@ ndbm_map_lookup(map, name, av, statp) datum key, val; int fd; char keybuf[MAXNAME + 1]; + struct stat stbuf; if (tTd(38, 20)) printf("ndbm_map_lookup(%s, %s)\n", @@ -960,9 +971,40 @@ ndbm_map_lookup(map, name, av, statp) makelower(keybuf); key.dptr = keybuf; } +lockdbm: fd = dbm_dirfno((DBM *) map->map_db1); if (fd >= 0 && !bitset(MF_LOCKED, map->map_mflags)) (void) lockfile(fd, map->map_file, ".dir", LOCK_SH); + if (fd < 0 || fstat(fd, &stbuf) < 0 || stbuf.st_mtime > map->map_mtime) + { + /* Reopen the database to sync the cache */ + int omode = bitset(map->map_mflags, MF_WRITABLE) ? O_RDWR + : O_RDONLY; + + map->map_class->map_close(map); + map->map_mflags &= ~(MF_OPEN|MF_WRITABLE); + if (map->map_class->map_open(map, omode)) + { + map->map_mflags |= MF_OPEN; + if ((omode && O_ACCMODE) == O_RDWR) + map->map_mflags |= MF_WRITABLE; + goto lockdbm; + } + else + { + if (!bitset(MF_OPTIONAL, map->map_mflags)) + { + extern MAPCLASS BogusMapClass; + + *statp = EX_TEMPFAIL; + map->map_class = &BogusMapClass; + map->map_mflags |= MF_OPEN; + syserr("Cannot reopen NDBM database %s", + map->map_file); + } + return NULL; + } + } val.dptr = NULL; if (bitset(MF_TRY0NULL, map->map_mflags)) { @@ -2489,7 +2531,7 @@ ldap_map_lookup(map, name, av, statp) filter, map->map_mname); } result = NULL; - *statp = EX_UNAVAILABLE; + *statp = EX_TEMPFAIL; goto quick_exit; } } diff --git a/usr.sbin/sendmail/src/queue.c b/usr.sbin/sendmail/src/queue.c index 1d812b8..d48efb1 100644 --- a/usr.sbin/sendmail/src/queue.c +++ b/usr.sbin/sendmail/src/queue.c @@ -36,9 +36,9 @@ #ifndef lint #if QUEUE -static char sccsid[] = "@(#)queue.c 8.174 (Berkeley) 7/23/97 (with queueing)"; +static char sccsid[] = "@(#)queue.c 8.175 (Berkeley) 10/4/97 (with queueing)"; #else -static char sccsid[] = "@(#)queue.c 8.174 (Berkeley) 7/23/97 (without queueing)"; +static char sccsid[] = "@(#)queue.c 8.175 (Berkeley) 10/4/97 (without queueing)"; #endif #endif /* not lint */ @@ -474,7 +474,6 @@ printctladdr(a, tfp) FILE *tfp; { char *uname; - char *paddr; register ADDRESS *q; uid_t uid; gid_t gid; @@ -514,12 +513,12 @@ printctladdr(a, tfp) lastuid = uid; lastctladdr = a; - paddr = denlstring(a->q_paddr, TRUE, FALSE); if (uid == 0 || uname == NULL || uname[0] == '\0') - fprintf(tfp, "C:%s\n", paddr); + fprintf(tfp, "C"); else - fprintf(tfp, "C%s:%ld:%ld:%s\n", - uname, (long) uid, (long) gid, paddr); + fprintf(tfp, "C%s:%ld:%ld", + denlstring(uname, TRUE, FALSE), (long) uid, (long) gid); + fprintf(tfp, ":%s\n", denlstring(a->q_paddr, TRUE, FALSE)); } /* ** RUNQUEUE -- run the jobs in the queue. diff --git a/usr.sbin/sendmail/src/version.c b/usr.sbin/sendmail/src/version.c index c531c5b..dc041ba 100644 --- a/usr.sbin/sendmail/src/version.c +++ b/usr.sbin/sendmail/src/version.c @@ -33,7 +33,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)version.c 8.8.7.3 (Berkeley) 8/3/97"; +static char sccsid[] = "@(#)version.c 8.8.8.1 (Berkeley) 10/24/97"; #endif /* not lint */ -char Version[] = "8.8.7"; +char Version[] = "8.8.8"; |