mirror of
https://github.com/openbsd/src.git
synced 2024-12-21 23:18:00 -08:00
In smtpd enable fdpassing on all imsgbufs apart from the one in mproc.c
that was specially handled before. On the control socket fdpassing needs to be enabled when a IMSG_CTL_SMTP_SESSION message is received. OK tb@
This commit is contained in:
parent
0a9d031fce
commit
bf921b2a26
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: control.c,v 1.131 2024/01/20 09:01:03 claudio Exp $ */
|
||||
/* $OpenBSD: control.c,v 1.132 2024/11/21 13:42:22 claudio Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 Gilles Chehade <gilles@poolp.org>
|
||||
@ -435,6 +435,7 @@ control_dispatch_ext(struct mproc *p, struct imsg *imsg)
|
||||
|
||||
switch (imsg->hdr.type) {
|
||||
case IMSG_CTL_SMTP_SESSION:
|
||||
imsgbuf_allow_fdpass(&p->imsgbuf);
|
||||
if (env->sc_flags & SMTPD_SMTP_PAUSED) {
|
||||
m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0);
|
||||
return;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: mproc.c,v 1.46 2024/11/21 13:32:02 claudio Exp $ */
|
||||
/* $OpenBSD: mproc.c,v 1.47 2024/11/21 13:42:22 claudio Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 Eric Faurot <eric@faurot.net>
|
||||
@ -65,7 +65,10 @@ err:
|
||||
void
|
||||
mproc_init(struct mproc *p, int fd)
|
||||
{
|
||||
imsgbuf_init(&p->imsgbuf, fd);
|
||||
if (imsgbuf_init(&p->imsgbuf, fd) == -1)
|
||||
fatal("mproc_init: imsgbuf_init");
|
||||
if (p->proc != PROC_CLIENT)
|
||||
imsgbuf_allow_fdpass(&p->imsgbuf);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: queue_proc.c,v 1.13 2024/11/21 13:22:21 claudio Exp $ */
|
||||
/* $OpenBSD: queue_proc.c,v 1.14 2024/11/21 13:42:22 claudio Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
|
||||
@ -291,7 +291,9 @@ queue_proc_init(struct passwd *pw, int server, const char *conf)
|
||||
if (fd == -1)
|
||||
fatalx("queue-proc: exiting");
|
||||
|
||||
imsgbuf_init(&ibuf, fd);
|
||||
if (imsgbuf_init(&ibuf, fd) == -1)
|
||||
fatal("queue-proc: exiting");
|
||||
imsgbuf_allow_fdpass(&ibuf);
|
||||
|
||||
version = PROC_QUEUE_API_VERSION;
|
||||
imsg_compose(&ibuf, PROC_QUEUE_INIT, 0, 0, -1,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: scheduler_proc.c,v 1.12 2024/11/21 13:22:21 claudio Exp $ */
|
||||
/* $OpenBSD: scheduler_proc.c,v 1.13 2024/11/21 13:42:22 claudio Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
|
||||
@ -104,7 +104,9 @@ scheduler_proc_init(const char *conf)
|
||||
if (fd == -1)
|
||||
fatalx("scheduler-proc: exiting");
|
||||
|
||||
imsgbuf_init(&ibuf, fd);
|
||||
if (imsgbuf_init(&ibuf, fd) == -1)
|
||||
fatal("scheduler-proc: exiting");
|
||||
imsgbuf_allow_fdpass(&ibuf);
|
||||
|
||||
version = PROC_SCHEDULER_API_VERSION;
|
||||
imsg_compose(&ibuf, PROC_SCHEDULER_INIT, 0, 0, -1,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: smtpctl.c,v 1.175 2024/11/21 13:26:25 claudio Exp $ */
|
||||
/* $OpenBSD: smtpctl.c,v 1.176 2024/11/21 13:42:22 claudio Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
|
||||
@ -118,7 +118,9 @@ srv_connect(void)
|
||||
}
|
||||
|
||||
ibuf = xcalloc(1, sizeof(struct imsgbuf));
|
||||
imsgbuf_init(ibuf, ctl_sock);
|
||||
if (imsgbuf_init(ibuf, ctl_sock) == -1)
|
||||
err(1, "imsgbuf_init");
|
||||
imsgbuf_allow_fdpass(ibuf);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user