minor tweaking of syslog levels & compile fixes for SunOS & Ultrix
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 2 May 1993 03:26:43 +0000 (19:26 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 2 May 1993 03:26:43 +0000 (19:26 -0800)
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 6.39
SCCS-vsn: usr.sbin/sendmail/src/queue.c 6.53
SCCS-vsn: usr.sbin/sendmail/src/alias.c 6.36
SCCS-vsn: usr.sbin/sendmail/src/udb.c 6.18
SCCS-vsn: usr.sbin/sendmail/src/map.c 6.12

usr/src/usr.sbin/sendmail/src/alias.c
usr/src/usr.sbin/sendmail/src/map.c
usr/src/usr.sbin/sendmail/src/queue.c
usr/src/usr.sbin/sendmail/src/recipient.c
usr/src/usr.sbin/sendmail/src/udb.c

index 8b1af9d..f07e734 100644 (file)
@@ -15,6 +15,7 @@ ERROR: DBM is no longer supported -- use NDBM instead.
 # endif
 
 # ifdef NEWDB
 # endif
 
 # ifdef NEWDB
+# undef __P
 # include <db.h>
 # endif
 
 # include <db.h>
 # endif
 
@@ -25,15 +26,15 @@ ERROR: DBM is no longer supported -- use NDBM instead.
 #ifndef lint
 #ifdef NEWDB
 #ifdef NDBM
 #ifndef lint
 #ifdef NEWDB
 #ifdef NDBM
-static char sccsid[] = "@(#)alias.c    6.35 (Berkeley) %G% (with NEWDB and NDBM)";
+static char sccsid[] = "@(#)alias.c    6.36 (Berkeley) %G% (with NEWDB and NDBM)";
 #else
 #else
-static char sccsid[] = "@(#)alias.c    6.35 (Berkeley) %G% (with NEWDB)";
+static char sccsid[] = "@(#)alias.c    6.36 (Berkeley) %G% (with NEWDB)";
 #endif
 #else
 #ifdef NDBM
 #endif
 #else
 #ifdef NDBM
-static char sccsid[] = "@(#)alias.c    6.35 (Berkeley) %G% (with NDBM)";
+static char sccsid[] = "@(#)alias.c    6.36 (Berkeley) %G% (with NDBM)";
 #else
 #else
-static char sccsid[] = "@(#)alias.c    6.35 (Berkeley) %G% (without NEWDB or NDBM)";
+static char sccsid[] = "@(#)alias.c    6.36 (Berkeley) %G% (without NEWDB or NDBM)";
 #endif
 #endif
 #endif /* not lint */
 #endif
 #endif
 #endif /* not lint */
@@ -959,7 +960,7 @@ forward(user, sendq, e)
                                printf("forward: transient error on %s\n", buf);
 #ifdef LOG
                        if (LogLevel > 2)
                                printf("forward: transient error on %s\n", buf);
 #ifdef LOG
                        if (LogLevel > 2)
-                               syslog(LOG_NOTICE, "%s: forward %s: transient error: %e",
+                               syslog(LOG_ERR, "%s: forward %s: transient error: %e",
                                        e->e_id, buf);
 #endif
                        message("%s: %s: message queued", buf, errstring(err));
                                        e->e_id, buf);
 #endif
                        message("%s: %s: message queued", buf, errstring(err));
index a9ca677..7ef0f38 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)map.c      6.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)map.c      6.12 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -16,6 +16,7 @@ static char sccsid[] = "@(#)map.c     6.11 (Berkeley) %G%";
 #include <ndbm.h>
 #endif
 #if defined(HASH_MAP) || defined(BTREE_MAP)
 #include <ndbm.h>
 #endif
 #if defined(HASH_MAP) || defined(BTREE_MAP)
+#undef __P
 #include <db.h>
 #endif
 #ifdef NIS_MAP
 #include <db.h>
 #endif
 #ifdef NIS_MAP
@@ -106,9 +107,9 @@ dbm_map_lookup(map, buf, bufsiz, av, statp)
        }
        if (bitset(MF_INCLNULL, map->map_flags))
                key.dsize++;
        }
        if (bitset(MF_INCLNULL, map->map_flags))
                key.dsize++;
-       (void) lockfile(dbm_dirfno(map->map_db), map->map_file, LOCK_SH);
-       val = dbm_fetch(map->map_db, key);
-       (void) lockfile(dbm_dirfno(map->map_db), map->map_file, LOCK_UN);
+       (void) lockfile(dbm_dirfno((DBM *) map->map_db), map->map_file, LOCK_SH);
+       val = dbm_fetch((DBM *) map->map_db, key);
+       (void) lockfile(dbm_dirfno((DBM *) map->map_db), map->map_file, LOCK_UN);
        if (val.dptr == NULL)
                return NULL;
        if (!bitset(MF_MATCHONLY, map->map_flags))
        if (val.dptr == NULL)
                return NULL;
        if (!bitset(MF_MATCHONLY, map->map_flags))
index cb07dd8..e11f236 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef QUEUE
 
 #ifndef lint
 #ifdef QUEUE
-static char sccsid[] = "@(#)queue.c    6.52 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c    6.53 (Berkeley) %G% (with queueing)";
 #else
 #else
-static char sccsid[] = "@(#)queue.c    6.52 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c    6.53 (Berkeley) %G% (without queueing)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -615,7 +615,7 @@ orderq(doall)
                                printf("orderq: bogus qf name %s\n", d->d_name);
 #ifdef LOG
                        if (LogLevel > 3)
                                printf("orderq: bogus qf name %s\n", d->d_name);
 #ifdef LOG
                        if (LogLevel > 3)
-                               syslog(LOG_NOTICE, "orderq: bogus qf name %s",
+                               syslog(LOG_CRIT, "orderq: bogus qf name %s",
                                        d->d_name);
 #endif
                        if (strlen(d->d_name) >= MAXNAME)
                                        d->d_name);
 #endif
                        if (strlen(d->d_name) >= MAXNAME)
index f542050..8f24be9 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)recipient.c        6.38 (Berkeley) %G%";
+static char sccsid[] = "@(#)recipient.c        6.39 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -327,7 +327,7 @@ recipient(a, sendq, e)
                        {
 #ifdef LOG
                                if (LogLevel > 2)
                        {
 #ifdef LOG
                                if (LogLevel > 2)
-                                       syslog(LOG_NOTICE, "%s: include %s: transient error: %e",
+                                       syslog(LOG_ERR, "%s: include %s: transient error: %e",
                                                e->e_id, a->q_user);
 #endif
                                a->q_flags |= QQUEUEUP|QDONTSEND;
                                                e->e_id, a->q_user);
 #endif
                                a->q_flags |= QQUEUEUP|QDONTSEND;
@@ -377,6 +377,7 @@ recipient(a, sendq, e)
        if (!bitset(QDONTSEND|QNOTREMOTE|QVERIFIED, a->q_flags))
        {
                extern int udbexpand();
        if (!bitset(QDONTSEND|QNOTREMOTE|QVERIFIED, a->q_flags))
        {
                extern int udbexpand();
+               extern int errno;
 
                if (udbexpand(a, sendq, e) == EX_TEMPFAIL)
                {
 
                if (udbexpand(a, sendq, e) == EX_TEMPFAIL)
                {
@@ -385,10 +386,11 @@ recipient(a, sendq, e)
                                e->e_message = newstr("Deferred: user database error");
 # ifdef LOG
                        if (LogLevel > 8)
                                e->e_message = newstr("Deferred: user database error");
 # ifdef LOG
                        if (LogLevel > 8)
-                               syslog(LOG_INFO, "%s: deferred: udbexpand",
+                               syslog(LOG_INFO, "%s: deferred: udbexpand: %e",
                                        e->e_id);
 # endif
                                        e->e_id);
 # endif
-                       message("queued (user database error)");
+                       message("queued (user database error): %s",
+                               errstring(errno));
                        e->e_nrcpts++;
                        return (a);
                }
                        e->e_nrcpts++;
                        return (a);
                }
index 680f3d8..1bcd9e3 100644 (file)
@@ -8,9 +8,9 @@
 
 #ifndef lint
 #ifdef USERDB
 
 #ifndef lint
 #ifdef USERDB
-static char sccsid [] = "@(#)udb.c     6.17 (Berkeley) %G% (with USERDB)";
+static char sccsid [] = "@(#)udb.c     6.18 (Berkeley) %G% (with USERDB)";
 #else
 #else
-static char sccsid [] = "@(#)udb.c     6.17 (Berkeley) %G% (without USERDB)";
+static char sccsid [] = "@(#)udb.c     6.18 (Berkeley) %G% (without USERDB)";
 #endif
 #endif
 
 #endif
 #endif
 
@@ -561,6 +561,11 @@ _udbx_init()
                        {
                                if (errno != ENOENT && errno != EACCES)
                                {
                        {
                                if (errno != ENOENT && errno != EACCES)
                                {
+#ifdef LOG
+                                       if (LogLevel > 2)
+                                               syslog(LOG_ERR, "dbopen(%s): %e",
+                                                       spec);
+#endif
                                        up->udb_type = UDB_EOLIST;
                                        goto tempfail;
                                }
                                        up->udb_type = UDB_EOLIST;
                                        goto tempfail;
                                }