SCCS-vsn: usr.sbin/sendmail/src/domain.c 5.32
SCCS-vsn: usr.sbin/sendmail/src/version.c 5.82
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 5.47
SCCS-vsn: usr.sbin/sendmail/src/queue.c 5.35
SCCS-vsn: usr.sbin/sendmail/src/alias.c 5.30
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 5.47
#ifndef lint
#ifdef NEWDB
#ifndef lint
#ifdef NEWDB
-static char sccsid[] = "@(#)alias.c 5.29 (Berkeley) %G% (with NEWDB)";
+static char sccsid[] = "@(#)alias.c 5.30 (Berkeley) %G% (with NEWDB)";
-static char sccsid[] = "@(#)alias.c 5.29 (Berkeley) %G% (with DBM)";
+static char sccsid[] = "@(#)alias.c 5.30 (Berkeley) %G% (with DBM)";
-static char sccsid[] = "@(#)alias.c 5.29 (Berkeley) %G% (without DBM)";
+static char sccsid[] = "@(#)alias.c 5.30 (Berkeley) %G% (without DBM)";
#endif
#endif
#endif /* not lint */
#endif
#endif
#endif /* not lint */
** Optionally, builds the .dir & .pag files.
*/
** Optionally, builds the .dir & .pag files.
*/
+# ifdef LOCKF
+# define RDLK_MODE "r+"
+# else
+# define RDLK_MODE "r"
+# endif
+
static
readaliases(aliasfile, init)
char *aliasfile;
static
readaliases(aliasfile, init)
char *aliasfile;
# endif
char line[BUFSIZ];
# endif
char line[BUFSIZ];
- if ((af = fopen(aliasfile, "r")) == NULL)
+ if ((af = fopen(aliasfile, RDLK_MODE)) == NULL)
{
if (tTd(27, 1))
printf("Can't open %s\n", aliasfile);
{
if (tTd(27, 1))
printf("Can't open %s\n", aliasfile);
-static char sccsid[] = "@(#)deliver.c 5.46 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c 5.47 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
#include <arpa/nameser.h>
#include <resolv.h>
#endif
#include <arpa/nameser.h>
#include <resolv.h>
#endif
+#ifdef LOCKF
+#include <unistd.h>
+#endif
/*
** DELIVER -- Deliver a message to a list of addresses.
/*
** DELIVER -- Deliver a message to a list of addresses.
/* be sure we are immune from the terminal */
disconnect(FALSE);
/* be sure we are immune from the terminal */
disconnect(FALSE);
+# ifdef LOCKF
+ /*
+ ** When our parent closed lockfp, we lost the lock.
+ ** Try to get it back now.
+ */
+
+ if (lockfp != NULL)
+ {
+ if (fseek(lockfp, 0, SEEK_SET) != 0 ||
+ lockf(fileno(lockfp), F_TLOCK, 0) < 0)
+ {
+ /* oops.... lost it */
+# ifdef LOG
+ if (LogLevel > 5)
+ syslog(LOG_NOTICE, "%s: lost lock",
+ CurEnv->e_id);
+# endif /* LOG */
+ fclose(lockfp);
+ exit(EX_OK);
+ }
+ }
+# endif /* LOCKF */
+
#ifndef lint
#ifdef NAMED_BIND
#ifndef lint
#ifdef NAMED_BIND
-static char sccsid[] = "@(#)domain.c 5.31 (Berkeley) %G% (with name server)";
+static char sccsid[] = "@(#)domain.c 5.32 (Berkeley) %G% (with name server)";
-static char sccsid[] = "@(#)domain.c 5.31 (Berkeley) %G% (without name server)";
+static char sccsid[] = "@(#)domain.c 5.32 (Berkeley) %G% (without name server)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
*/
if (errno == ECONNREFUSED) {
h_errno = TRY_AGAIN;
*/
if (errno == ECONNREFUSED) {
h_errno = TRY_AGAIN;
}
if (h_errno == NO_DATA)
{
}
if (h_errno == NO_DATA)
{
}
if ((h_errno != HOST_NOT_FOUND) ||
(_res.options & RES_DNSRCH) == 0)
}
if ((h_errno != HOST_NOT_FOUND) ||
(_res.options & RES_DNSRCH) == 0)
+ /*
+ ** Try the unmodified name.
+ */
+
cp = host;
if (tTd(8, 5))
printf("getcanonname: trying %s\n", cp);
cp = host;
if (tTd(8, 5))
printf("getcanonname: trying %s\n", cp);
{
if (tTd(8, 8))
printf("\tNO: h_errno=%d\n", h_errno);
{
if (tTd(8, 8))
printf("\tNO: h_errno=%d\n", h_errno);
+ if (h_errno != NO_DATA)
+ return FALSE;
if (tTd(8, 20))
printf("qdcount failure (%d)\n",
ntohs(hp->qdcount));
if (tTd(8, 20))
printf("qdcount failure (%d)\n",
ntohs(hp->qdcount));
- return rval; /* ???XXX??? */
+ return FALSE; /* ???XXX??? */
#ifndef lint
#ifdef QUEUE
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 5.34 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c 5.35 (Berkeley) %G% (with queueing)";
-static char sccsid[] = "@(#)queue.c 5.34 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c 5.35 (Berkeley) %G% (without queueing)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
# ifdef LOCKF
if (lockf(fd, F_TLOCK, 0) < 0)
{
# ifdef LOCKF
if (lockf(fd, F_TLOCK, 0) < 0)
{
+ if (errno != EACCES && errno != EAGAIN)
syserr("cannot lockf(%s)", tf);
close(fd);
fd = -1;
syserr("cannot lockf(%s)", tf);
close(fd);
fd = -1;
** we had been invoked by argument.
*/
** we had been invoked by argument.
*/
+# ifdef LOCKF
+# define RDLK_MODE "r+"
+# else
+# define RDLK_MODE "r"
+# endif
+
FILE *
readqf(e, full)
register ENVELOPE *e;
FILE *
readqf(e, full)
register ENVELOPE *e;
*/
qf = queuename(e, 'q');
*/
qf = queuename(e, 'q');
+ qfp = fopen(qf, RDLK_MODE);
if (qfp == NULL)
{
if (errno != ENOENT)
if (qfp == NULL)
{
if (errno != ENOENT)
-static char sccsid[] = "@(#)version.c 5.81 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c 5.82 (Berkeley) %G%";
-char Version[] = "5.81";
+char Version[] = "5.82";