diff options
author | gilles <gilles@openbsd.org> | 2019-12-18 10:00:39 +0000 |
---|---|---|
committer | gilles <gilles@openbsd.org> | 2019-12-18 10:00:39 +0000 |
commit | 9741db967800a0b66b770b7523a59ba5c1e3968c (patch) | |
tree | 79fc2da0e87fa7d515912fc4413699fe2f62a8d0 | |
parent | teach relay action how to do domain-based relay host, this allows declaring (diff) | |
download | OpenSMTPD-9741db967800a0b66b770b7523a59ba5c1e3968c.tar.xz OpenSMTPD-9741db967800a0b66b770b7523a59ba5c1e3968c.zip |
give a better name to a couple functions and struct fields related to
filters, no functional change
-rw-r--r-- | config.c | 10 | ||||
-rw-r--r-- | parse.y | 10 | ||||
-rw-r--r-- | smtpd.c | 24 | ||||
-rw-r--r-- | smtpd.h | 4 |
4 files changed, 24 insertions, 24 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.50 2019/09/20 17:46:05 gilles Exp $ */ +/* $OpenBSD: config.c,v 1.51 2019/12/18 10:00:39 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -89,7 +89,7 @@ config_default(void) conf->sc_ssl_dict = calloc(1, sizeof(*conf->sc_ssl_dict)); conf->sc_limits_dict = calloc(1, sizeof(*conf->sc_limits_dict)); conf->sc_mda_wrappers = calloc(1, sizeof(*conf->sc_mda_wrappers)); - conf->sc_processors_dict = calloc(1, sizeof(*conf->sc_processors_dict)); + conf->sc_filter_processes_dict = calloc(1, sizeof(*conf->sc_filter_processes_dict)); conf->sc_dispatcher_bounce = calloc(1, sizeof(*conf->sc_dispatcher_bounce)); conf->sc_filters_dict = calloc(1, sizeof(*conf->sc_filters_dict)); limits = calloc(1, sizeof(*limits)); @@ -103,7 +103,7 @@ config_default(void) conf->sc_ssl_dict == NULL || conf->sc_limits_dict == NULL || conf->sc_mda_wrappers == NULL || - conf->sc_processors_dict == NULL || + conf->sc_filter_processes_dict == NULL || conf->sc_dispatcher_bounce == NULL || conf->sc_filters_dict == NULL || limits == NULL) @@ -116,7 +116,7 @@ config_default(void) dict_init(conf->sc_ssl_dict); dict_init(conf->sc_tables_dict); dict_init(conf->sc_limits_dict); - dict_init(conf->sc_processors_dict); + dict_init(conf->sc_filter_processes_dict); limit_mta_set_defaults(limits); @@ -155,7 +155,7 @@ error: free(conf->sc_ssl_dict); free(conf->sc_limits_dict); free(conf->sc_mda_wrappers); - free(conf->sc_processors_dict); + free(conf->sc_filter_processes_dict); free(conf->sc_dispatcher_bounce); free(conf->sc_filters_dict); free(limits); @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.270 2019/12/18 07:57:52 gilles Exp $ */ +/* $OpenBSD: parse.y,v 1.271 2019/12/18 10:00:39 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -434,7 +434,7 @@ pki_params_opt pki_params proc: PROC STRING STRING { - if (dict_get(conf->sc_processors_dict, $2)) { + if (dict_get(conf->sc_filter_processes_dict, $2)) { yyerror("processor already exists with that name: %s", $2); free($2); free($3); @@ -443,7 +443,7 @@ PROC STRING STRING { processor = xcalloc(1, sizeof *processor); processor->command = $3; } proc_params { - dict_set(conf->sc_processors_dict, $2, processor); + dict_set(conf->sc_filter_processes_dict, $2, processor); processor = NULL; } ; @@ -1794,7 +1794,7 @@ FILTER STRING PROC STRING { free($4); YYERROR; } - if ((fp = dict_get(conf->sc_processors_dict, $4)) == NULL) { + if ((fp = dict_get(conf->sc_filter_processes_dict, $4)) == NULL) { yyerror("no processor exist with that name: %s", $4); free($4); YYERROR; @@ -1825,7 +1825,7 @@ FILTER STRING PROC_EXEC STRING { filter_config->proc = xstrdup($2); dict_set(conf->sc_filters_dict, $2, filter_config); } proc_params { - dict_set(conf->sc_processors_dict, filter_config->proc, processor); + dict_set(conf->sc_filter_processes_dict, filter_config->proc, processor); processor = NULL; filter_config = NULL; } @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.327 2019/12/13 08:14:51 gilles Exp $ */ +/* $OpenBSD: smtpd.c,v 1.328 2019/12/18 10:00:39 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -90,8 +90,8 @@ static int parent_auth_user(const char *, const char *); static void load_pki_tree(void); static void load_pki_keys(void); -static void fork_processors(void); -static void fork_processor(const char *, const char *, const char *, const char *, const char *, uint32_t); +static void fork_filter_processes(void); +static void fork_filter_process(const char *, const char *, const char *, const char *, const char *, uint32_t); enum child_type { CHILD_DAEMON, @@ -260,7 +260,7 @@ parent_imsg(struct mproc *p, struct imsg *imsg) m_get_string(&m, &procname); m_end(&m); - processor = dict_xget(env->sc_processors_dict, procname); + processor = dict_xget(env->sc_filter_processes_dict, procname); m_create(p_lka, IMSG_LKA_PROCESSOR_ERRFD, 0, 0, processor->errfd); m_add_string(p_lka, procname); m_close(p_lka); @@ -1079,7 +1079,7 @@ smtpd(void) { offline_timeout.tv_usec = 0; evtimer_add(&offline_ev, &offline_timeout); - fork_processors(); + fork_filter_processes(); purge_task(); @@ -1257,7 +1257,7 @@ purge_task(void) } static void -fork_processors(void) +fork_filter_processes(void) { const char *name; void *iter; @@ -1282,18 +1282,18 @@ fork_processors(void) iter = NULL; while (dict_iter(env->sc_filters_dict, &iter, (const char **)&fn, (void **)&fc)) { if (fc->proc) { - fp = dict_xget(env->sc_processors_dict, fc->proc); + fp = dict_xget(env->sc_filter_processes_dict, fc->proc); fp->filter_subsystem |= fc->filter_subsystem; } } iter = NULL; - while (dict_iter(env->sc_processors_dict, &iter, &name, (void **)&fp)) - fork_processor(name, fp->command, fp->user, fp->group, fp->chroot, fp->filter_subsystem); + while (dict_iter(env->sc_filter_processes_dict, &iter, &name, (void **)&fp)) + fork_filter_process(name, fp->command, fp->user, fp->group, fp->chroot, fp->filter_subsystem); } static void -fork_processor(const char *name, const char *command, const char *user, const char *group, const char *chroot_path, uint32_t subsystems) +fork_filter_process(const char *name, const char *command, const char *user, const char *group, const char *chroot_path, uint32_t subsystems) { pid_t pid; struct filter_proc *processor; @@ -1328,7 +1328,7 @@ fork_processor(const char *name, const char *command, const char *user, const ch /* parent passes the child fd over to lka */ if (pid > 0) { - processor = dict_xget(env->sc_processors_dict, name); + processor = dict_xget(env->sc_filter_processes_dict, name); processor->errfd = errfd[1]; child_add(pid, CHILD_PROCESSOR, name); close(sp[0]); @@ -1354,7 +1354,7 @@ fork_processor(const char *name, const char *command, const char *user, const ch if (setgroups(1, &gr->gr_gid) || setresgid(gr->gr_gid, gr->gr_gid, gr->gr_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) - err(1, "fork_processor: cannot drop privileges"); + err(1, "fork_filter_process: cannot drop privileges"); if (closefrom(STDERR_FILENO + 1) == -1) err(1, "closefrom"); @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.646 2019/12/18 07:57:52 gilles Exp $ */ +/* $OpenBSD: smtpd.h,v 1.647 2019/12/18 10:00:39 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -585,7 +585,7 @@ struct smtpd { size_t sc_scheduler_max_msg_batch_size; size_t sc_scheduler_max_schedule; - struct dict *sc_processors_dict; + struct dict *sc_filter_processes_dict; int sc_ttl; #define MAX_BOUNCE_WARN 4 |