diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-11-02 12:58:58 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-11-02 12:58:58 +0200 |
commit | f127def749e7e49e55fb212aecf10594613f337e (patch) | |
tree | 09511e8cb652442a20d3861a43d98c5cb4f19d82 /src | |
parent | 520ca3e09a517af45b73b37075cc3a87dc966eb5 (diff) | |
download | mailfromd-f127def749e7e49e55fb212aecf10594613f337e.tar.gz mailfromd-f127def749e7e49e55fb212aecf10594613f337e.tar.bz2 |
calloutd: implement the --resolv-conf-file option
Diffstat (limited to 'src')
-rw-r--r-- | src/calloutd.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/calloutd.c b/src/calloutd.c index 56dd2a44..1f25649c 100644 --- a/src/calloutd.c +++ b/src/calloutd.c | |||
@@ -48,6 +48,8 @@ callout_alloc_die() | |||
48 | const char *program_version = "calloutd (" PACKAGE_STRING ")"; | 48 | const char *program_version = "calloutd (" PACKAGE_STRING ")"; |
49 | static char prog_doc[] = N_("calloutd -- a call out server"); | 49 | static char prog_doc[] = N_("calloutd -- a call out server"); |
50 | 50 | ||
51 | static char *resolv_conf_file; | ||
52 | |||
51 | struct mu_cfg_param callout_cfg_param[] = { | 53 | struct mu_cfg_param callout_cfg_param[] = { |
52 | { ".mfd:server", mu_cfg_section, NULL, 0, NULL, NULL }, | 54 | { ".mfd:server", mu_cfg_section, NULL, 0, NULL, NULL }, |
53 | { "lock-retry-count", mu_cfg_callback, NULL, 0, | 55 | { "lock-retry-count", mu_cfg_callback, NULL, 0, |
@@ -57,8 +59,7 @@ struct mu_cfg_param callout_cfg_param[] = { | |||
57 | { "lock-retry-timeout", mu_cfg_callback, NULL, 0, | 59 | { "lock-retry-timeout", mu_cfg_callback, NULL, 0, |
58 | config_cb_lock_retry_timeout, | 60 | config_cb_lock_retry_timeout, |
59 | N_("Set the time span between the two DBM locking attempts."), | 61 | N_("Set the time span between the two DBM locking attempts."), |
60 | N_("time: interval") }, | 62 | N_("time: interval") }, |
61 | |||
62 | { NULL } | 63 | { NULL } |
63 | }; | 64 | }; |
64 | 65 | ||
@@ -81,7 +82,16 @@ mf_server_function(const char *key, struct mf_srvcfg *cfg) | |||
81 | return 0; | 82 | return 0; |
82 | } | 83 | } |
83 | 84 | ||
85 | static struct mu_option calloutd_options[] = { | ||
86 | MU_OPTION_GROUP(N_("General options")), | ||
87 | { "resolv-conf-file", 0, N_("FILE"), MU_OPTION_DEFAULT, | ||
88 | N_("read resolver configuration from FILE"), | ||
89 | mu_c_string, &resolv_conf_file }, | ||
90 | MU_OPTION_END | ||
91 | }, *options[] = { calloutd_options, NULL }; | ||
92 | |||
84 | struct mu_cli_setup cli = { | 93 | struct mu_cli_setup cli = { |
94 | .optv = options, | ||
85 | .cfg = callout_cfg_param, | 95 | .cfg = callout_cfg_param, |
86 | .prog_doc = prog_doc, | 96 | .prog_doc = prog_doc, |
87 | }; | 97 | }; |
@@ -108,6 +118,9 @@ main(int argc, char **argv) | |||
108 | mf_srvcfg_init(argv[0], NULL); | 118 | mf_srvcfg_init(argv[0], NULL); |
109 | mf_getopt(&cli, &argc, &argv, capa, MF_GETOPT_DEFAULT); | 119 | mf_getopt(&cli, &argc, &argv, capa, MF_GETOPT_DEFAULT); |
110 | 120 | ||
121 | if (resolv_conf_file) | ||
122 | dnsbase_file_init(resolv_conf_file); | ||
123 | |||
111 | mf_srvcfg_flush(); | 124 | mf_srvcfg_flush(); |
112 | 125 | ||
113 | mf_server_lint_option = "--config-lint"; | 126 | mf_server_lint_option = "--config-lint"; |