diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2012-08-25 22:52:20 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2012-08-25 22:52:20 +0000 |
commit | f306d139dbf080f0221fe7bae15fed27738ebd01 (patch) | |
tree | 3ca8ac94ab7f6a41be7dc47b093142efbf1c4dbe /usr.sbin/smtpd/lka.c | |
parent | 3629fb9fa6d370a3d60b9e1bf72160c1a7f3bcc8 (diff) |
lka must not start servicing requests until it has received its full config
from parent. Disable imsg from other processes until then. Fix some races
when the mta tries to lookup an auth map too early, for example.
ok gilles@ chl@
Diffstat (limited to 'usr.sbin/smtpd/lka.c')
-rw-r--r-- | usr.sbin/smtpd/lka.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index 1e1bae88ee9..54c710e487d 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.134 2012/08/18 18:18:23 gilles Exp $ */ +/* $OpenBSD: lka.c,v 1.135 2012/08/25 22:52:19 eric Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -197,6 +197,11 @@ lka_imsg(struct imsgev *iev, struct imsg *imsg) purge_config(PURGE_MAPS); env->sc_rules = env->sc_rules_reload; env->sc_maps = env->sc_maps_reload; + + /* start fulfilling requests */ + event_add(&env->sc_ievs[PROC_MTA]->ev, NULL); + event_add(&env->sc_ievs[PROC_MFA]->ev, NULL); + event_add(&env->sc_ievs[PROC_SMTP]->ev, NULL); return; case IMSG_CTL_VERBOSE: @@ -303,6 +308,11 @@ lka(void) config_pipes(peers, nitems(peers)); config_peers(peers, nitems(peers)); + /* ignore them until we get our config */ + event_del(&env->sc_ievs[PROC_MTA]->ev); + event_del(&env->sc_ievs[PROC_MFA]->ev); + event_del(&env->sc_ievs[PROC_SMTP]->ev); + if (event_dispatch() < 0) fatal("event_dispatch"); lka_shutdown(); |