diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-10-07 18:19:40 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2009-10-07 18:19:40 +0000 |
commit | 4e368570f9df768d6ef67b3d86958db4c18cc6e4 (patch) | |
tree | 3d757287aabd97bb63b2de6198282a35c570ba1c | |
parent | 0bd78cb0adb577d00248762e6f5f78cb75047c48 (diff) |
now that mfa no longer does ruleset matching, parent no longer needs to
send it the ruleset configuration, and mfa no longer needs to interpret
it and load it in memory. kill kill kill. as an added bonus: removes 88
lines of code :-)
-rw-r--r-- | usr.sbin/smtpd/mfa.c | 89 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 3 |
2 files changed, 2 insertions, 90 deletions
diff --git a/usr.sbin/smtpd/mfa.c b/usr.sbin/smtpd/mfa.c index 59f968af1e2..d0708f51b32 100644 --- a/usr.sbin/smtpd/mfa.c +++ b/usr.sbin/smtpd/mfa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfa.c,v 1.39 2009/10/07 18:09:12 gilles Exp $ */ +/* $OpenBSD: mfa.c,v 1.40 2009/10/07 18:19:39 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -99,93 +99,6 @@ mfa_dispatch_parent(int sig, short event, void *p) break; switch (imsg.hdr.type) { - case IMSG_CONF_START: - if ((env->sc_rules_reload = calloc(1, sizeof(*env->sc_rules))) == NULL) - fatal("mfa_dispatch_parent: calloc"); - if ((env->sc_maps_reload = calloc(1, sizeof(*env->sc_maps))) == NULL) - fatal("mfa_dispatch_parent: calloc"); - TAILQ_INIT(env->sc_rules_reload); - TAILQ_INIT(env->sc_maps_reload); - break; - case IMSG_CONF_RULE: { - struct rule *rule = imsg.data; - - IMSG_SIZE_CHECK(rule); - - rule = calloc(1, sizeof(*rule)); - if (rule == NULL) - fatal("mfa_dispatch_parent: calloc"); - *rule = *(struct rule *)imsg.data; - - TAILQ_INIT(&rule->r_conditions); - TAILQ_INSERT_TAIL(env->sc_rules_reload, rule, r_entry); - break; - } - case IMSG_CONF_CONDITION: { - struct rule *r = TAILQ_LAST(env->sc_rules_reload, rulelist); - struct cond *cond = imsg.data; - - IMSG_SIZE_CHECK(cond); - - cond = calloc(1, sizeof(*cond)); - if (cond == NULL) - fatal("mfa_dispatch_parent: calloc"); - *cond = *(struct cond *)imsg.data; - - TAILQ_INSERT_TAIL(&r->r_conditions, cond, c_entry); - break; - } - case IMSG_CONF_MAP: { - struct map *m = imsg.data; - - IMSG_SIZE_CHECK(m); - - m = calloc(1, sizeof(*m)); - if (m == NULL) - fatal("mfa_dispatch_parent: calloc"); - *m = *(struct map *)imsg.data; - - TAILQ_INIT(&m->m_contents); - TAILQ_INSERT_TAIL(env->sc_maps_reload, m, m_entry); - break; - } - case IMSG_CONF_RULE_SOURCE: { - struct rule *rule = TAILQ_LAST(env->sc_rules_reload, rulelist); - char *sourcemap = imsg.data; - void *temp = env->sc_maps; - - /* map lookup must be done in the reloaded conf */ - env->sc_maps = env->sc_maps_reload; - rule->r_sources = map_findbyname(env, sourcemap); - if (rule->r_sources == NULL) - fatalx("maps inconsistency"); - env->sc_maps = temp; - break; - } - case IMSG_CONF_MAP_CONTENT: { - struct map *m = TAILQ_LAST(env->sc_maps_reload, maplist); - struct mapel *mapel = imsg.data; - - IMSG_SIZE_CHECK(mapel); - - mapel = calloc(1, sizeof(*mapel)); - if (mapel == NULL) - fatal("mfa_dispatch_parent: calloc"); - *mapel = *(struct mapel *)imsg.data; - - TAILQ_INSERT_TAIL(&m->m_contents, mapel, me_entry); - break; - } - case IMSG_CONF_END: { - /* switch and destroy old ruleset */ - if (env->sc_rules) - purge_config(env, PURGE_RULES); - if (env->sc_maps) - purge_config(env, PURGE_MAPS); - env->sc_rules = env->sc_rules_reload; - env->sc_maps = env->sc_maps_reload; - break; - } default: log_warnx("mfa_dispatch_parent: got imsg %d", imsg.hdr.type); diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 184642a62c0..735ee4167b4 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.85 2009/09/04 11:49:23 jacekm Exp $ */ +/* $OpenBSD: smtpd.c,v 1.86 2009/10/07 18:19:39 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -120,7 +120,6 @@ parent_send_config(int fd, short event, void *p) { parent_send_config_listeners(p); parent_send_config_client_certs(p); - parent_send_config_ruleset(p, PROC_MFA); parent_send_config_ruleset(p, PROC_LKA); } |