From f306d139dbf080f0221fe7bae15fed27738ebd01 Mon Sep 17 00:00:00 2001 From: Eric Faurot Date: Sat, 25 Aug 2012 22:52:20 +0000 Subject: 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@ --- usr.sbin/smtpd/lka.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'usr.sbin') 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 @@ -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(); -- cgit v1.2.3