summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/lka.c
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2019-06-27 05:14:50 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2019-06-27 05:14:50 +0000
commitd9f53b2bae5dfb54aaae7061b3798326b7f45cb3 (patch)
treedbfae173ff1ff607c44dec327ee91d3b71248eac /usr.sbin/smtpd/lka.c
parent0048624a0d0ae16c904fc227be498cbd36f68824 (diff)
Allow filters to log information through stderr. This simplifies and
unifies the way filters need to get their logging to the right location. Log-messages are read line by line and are logged at LOG_ERR level via the lookup process. OK gilles@
Diffstat (limited to 'usr.sbin/smtpd/lka.c')
-rw-r--r--usr.sbin/smtpd/lka.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c
index d5d55410231..6548700e33a 100644
--- a/usr.sbin/smtpd/lka.c
+++ b/usr.sbin/smtpd/lka.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka.c,v 1.234 2019/06/13 11:45:34 eric Exp $ */
+/* $OpenBSD: lka.c,v 1.235 2019/06/27 05:14:49 martijn Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -360,9 +360,21 @@ lka_imsg(struct mproc *p, struct imsg *imsg)
m_get_string(&m, &procname);
m_end(&m);
+ m_create(p, IMSG_LKA_PROCESSOR_ERRFD, 0, 0, -1);
+ m_add_string(p, procname);
+ m_close(p);
+
lka_proc_forked(procname, imsg->fd);
return;
+ case IMSG_LKA_PROCESSOR_ERRFD:
+ m_msg(&m, imsg);
+ m_get_string(&m, &procname);
+ m_end(&m);
+
+ lka_proc_errfd(procname, imsg->fd);
+ shutdown(imsg->fd, SHUT_WR);
+ return;
case IMSG_REPORT_SMTP_LINK_CONNECT:
m_msg(&m, imsg);