diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-06-17 13:02:21 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-06-17 13:02:21 +0300 |
commit | f8f65c7e1713e516083bc2ced9794d2b648ad2de (patch) | |
tree | e3b5f5783987888287acaf9cb4b1204296a93b9b | |
parent | 7b917c501cb998d4e461a147079eb106f4ce75cf (diff) | |
download | mailfromd-f8f65c7e1713e516083bc2ced9794d2b648ad2de.tar.gz mailfromd-f8f65c7e1713e516083bc2ced9794d2b648ad2de.tar.bz2 |
Bugfixes.
* pies/pies.c (main): Change main loop to do..while,
otherwise a signal arriving before entering the loop
might cause the program to terminate.
* pmult/pmult.c (internal_macro_p): New function.
(collect_stage_symbols): Do not report internal
macros as untranslatable.
* mfd/gram.y (register_macro): Copy macro name to
allocated storage.
-rw-r--r-- | mfd/gram.y | 2 | ||||
-rw-r--r-- | pies/pies.c | 4 | ||||
-rw-r--r-- | pmult/pmult.c | 52 |
3 files changed, 52 insertions, 6 deletions
@@ -2519,3 +2519,3 @@ register_macro(enum smtp_state state, const char *macro) if (mu_list_locate(smtp_macro_list[ind], (void*) macro, NULL)) - mu_list_append(smtp_macro_list[ind], (void*) macro); + mu_list_append(smtp_macro_list[ind], (void*) strdup (macro)); } diff --git a/pies/pies.c b/pies/pies.c index 8948bcee..04a59468 100644 --- a/pies/pies.c +++ b/pies/pies.c @@ -1521,3 +1521,3 @@ main (int argc, char **argv) - while (action == ACTION_CONT) + do { @@ -1553,2 +1553,4 @@ main (int argc, char **argv) } + while (action == ACTION_CONT); + progman_stop (); diff --git a/pmult/pmult.c b/pmult/pmult.c index 2d94a072..e9d7a720 100644 --- a/pmult/pmult.c +++ b/pmult/pmult.c @@ -1305,2 +1305,43 @@ static int gacopyz_to_smst[] = { + +/* Tables of macros defined internally by pmult */ +/* NOTE: Update them wherever you add or remove macros in the handlers + below. + FIXME: Find a way to automate this. */ +static const char *conn_imt[] = { "r", "i", "client_addr", "client_name", + "client_port", NULL }; +static const char *helo_imt[] = { "s", NULL }; +static const char *mail_imt[] = { "f", "ntries", "nrcpts", "nbadrcpts", NULL }; +static const char *rcpt_imt[] = { "nrcpts", "nbadrcpts", "rcpt_host", + "rcpt_addr", NULL }; +#define data_imt NULL +#define eom_imt NULL +#define eoh_imt NULL + +static const char **internal_macro_tab[gacopyz_stage_max] = { + conn_imt, + helo_imt, + mail_imt, + rcpt_imt, + data_imt, + eom_imt, + eoh_imt, +}; + +static int +internal_macro_p (enum gacopyz_stage gstage, const char *macro) +{ + int i; + + for (i = 0; i <= gstage; i++) + if (internal_macro_tab[i]) + { + const char **p; + for (p = internal_macro_tab[i]; *p; p++) + if (strcmp (macro, *p) == 0) + return 1; + } + return 0; +} + /* For each Sendmail macro name from SYMV, find the corresponding @@ -1321,3 +1362,6 @@ collect_stage_symbols (enum gacopyz_stage gstage, const char **symv) int macro; - + + if (internal_macro_p (gstage, *symv)) + continue; + if (i == PM_MAX_MACROS) @@ -1330,5 +1374,2 @@ collect_stage_symbols (enum gacopyz_stage gstage, const char **symv) - if (macro_defined (macrotab[smst], i, macro)) - continue; - if (mu_kwd_xlat_name (macro_trans, *symv, ¯o)) @@ -1341,2 +1382,5 @@ collect_stage_symbols (enum gacopyz_stage gstage, const char **symv) + if (macro_defined (macrotab[smst], i, macro)) + continue; + if (mu_kwd_xlat_tok (macro_trans, macro, |