aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2020-05-06 16:03:30 +0000
committerGilles Chehade <gilles@poolp.org>2020-05-13 22:59:01 +0200
commit5f96013da6ee5ff20f8e90fa4dfa04a109970815 (patch)
tree2c3e72eaa236d94cbe09f8e64cbbd1b4aec2d7a3
parentmove (diff)
downloadOpenSMTPD-5f96013da6ee5ff20f8e90fa4dfa04a109970815.tar.xz
OpenSMTPD-5f96013da6ee5ff20f8e90fa4dfa04a109970815.zip
Only allow forkmda() to be called from a local action dispatcher.
From gilles@, OK deraadt@ jung@
-rw-r--r--usr.sbin/smtpd/smtpd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c
index e8b361fd..f18b1446 100644
--- a/usr.sbin/smtpd/smtpd.c
+++ b/usr.sbin/smtpd/smtpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.c,v 1.332 2020/02/24 16:16:08 millert Exp $ */
+/* $OpenBSD: smtpd.c,v 1.333 2020/05/06 16:03:30 millert Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -1471,6 +1471,8 @@ forkmda(struct mproc *p, uint64_t id, struct deliver *deliver)
const char *pw_dir;
dsp = dict_xget(env->sc_dispatchers, deliver->dispatcher);
+ if (dsp->type != DISPATCHER_LOCAL)
+ fatalx("non-local dispatcher called from forkmda()");
log_debug("debug: smtpd: forking mda for session %016"PRIx64
": %s as %s", id, deliver->userinfo.username,