diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-02-22 23:29:55 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-02-22 23:29:55 +0000 |
commit | 11ad1a96ad57aa925eb1465e588ba29c6d0d2602 (patch) | |
tree | 0ea5f382413b9f74cc4246ff8a71e9cf914a6d53 /usr.sbin/smtpd/queue_shared.c | |
parent | ac70f3f5fb8464487a5420dc7bf78c59445a9c6a (diff) |
Fix race possible between runner and queue when starting up.
runner_reset_flags would attempt to update envelope, but its
envelope.tmp could be renamed by queue_purge. The fix is to store
envelope.tmp in a place no other process writes to, and
/queue/envelope.tmp is perfect for this.
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/queue_shared.c')
-rw-r--r-- | usr.sbin/smtpd/queue_shared.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/queue_shared.c b/usr.sbin/smtpd/queue_shared.c index 0875b768bfe..f61d54ea7c6 100644 --- a/usr.sbin/smtpd/queue_shared.c +++ b/usr.sbin/smtpd/queue_shared.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue_shared.c,v 1.11 2009/02/22 11:55:17 jacekm Exp $ */ +/* $OpenBSD: queue_shared.c,v 1.12 2009/02/22 23:29:54 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -624,6 +624,8 @@ walk_queue(struct qwalk *q, char *fname) switch (q->level) { case 0: + if (strcmp(fname, "envelope.tmp") == 0) + return (QWALK_AGAIN); q->bucket = strtonum(fname, 0, DIRHASH_BUCKETS - 1, &errstr); if (errstr) { log_warnx("walk_queue: invalid bucket: %s", fname); |