summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/queue.c
diff options
context:
space:
mode:
authorJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-01-28 17:29:12 +0000
committerJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-01-28 17:29:12 +0000
commit1670dd7aac37cc5b3762904fbc126d853757833d (patch)
tree9372bff0bcba161a2ffd2054680eeb2fb7f7c359 /usr.sbin/smtpd/queue.c
parent91263de6542bab4330c09f524ae97bec31d687c1 (diff)
Make races between queue and runner impossible by implementing the policy:
1) queue never reads /queue. 2) queue writes to /queue only at message injection time. 3) runner does all reading, and all writing apart from 2). ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/queue.c')
-rw-r--r--usr.sbin/smtpd/queue.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c
index 19033c44d53..d0715dfa2a3 100644
--- a/usr.sbin/smtpd/queue.c
+++ b/usr.sbin/smtpd/queue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue.c,v 1.50 2009/01/28 12:58:17 gilles Exp $ */
+/* $OpenBSD: queue.c,v 1.51 2009/01/28 17:29:11 jacekm Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -306,7 +306,8 @@ queue_dispatch_mda(int sig, short event, void *p)
switch (imsg.hdr.type) {
case IMSG_QUEUE_MESSAGE_UPDATE: {
- queue_message_update(imsg.data);
+ imsg_compose(env->sc_ibufs[PROC_RUNNER], IMSG_RUNNER_UPDATE_ENVELOPE,
+ 0, 0, -1, imsg.data, sizeof(struct message));
break;
}
@@ -369,7 +370,8 @@ queue_dispatch_mta(int sig, short event, void *p)
}
case IMSG_QUEUE_MESSAGE_UPDATE: {
- queue_message_update(imsg.data);
+ imsg_compose(env->sc_ibufs[PROC_RUNNER], IMSG_RUNNER_UPDATE_ENVELOPE,
+ 0, 0, -1, imsg.data, sizeof(struct message));
break;
}