This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Mailutils".
http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=fd5b5599ee96293812d33f8dcb837ada35526097 The branch, master has been updated via fd5b5599ee96293812d33f8dcb837ada35526097 (commit) from e68db77391acf334fd6920cbd2c84413dcf5ced0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fd5b5599ee96293812d33f8dcb837ada35526097 Author: Sergey Poznyakoff <g...@gnu.org.ua> Date: Tue May 19 17:02:18 2009 +0300 Bugfixes * maidag/deliver.c: Run filter scripts with user privileges. * maidag/script.c (apply_script): Use stat, not access, to check for the existence of the script file. Access takes into account accessibility of intermediate directories, which is irrelevant in this case. * mailbox/mutil.c (mu_expand_path_pattern): Bugfix. Remove the % format specifiers after expanding them. ----------------------------------------------------------------------- Summary of changes: maidag/deliver.c | 7 ++++++- maidag/script.c | 10 ++++++++-- mailbox/mutil.c | 39 +++++++++++++++++++++------------------ 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/maidag/deliver.c b/maidag/deliver.c index 87e3cd0..0bf750e 100644 --- a/maidag/deliver.c +++ b/maidag/deliver.c @@ -307,7 +307,12 @@ deliver_url (mu_url_t url, mu_message_t msg, const char *name, char **errp) if (current_uid) auth->change_uid = 0; - if (script_apply (msg, auth)) + if (switch_user_id (auth, 1)) + return EX_TEMPFAIL; + status = script_apply (msg, auth); + if (switch_user_id (auth, 0)) + return EX_TEMPFAIL; + if (status) { exit_code = EX_OK; mu_auth_data_free (auth); diff --git a/maidag/script.c b/maidag/script.c index 999e550..8bd6aba 100644 --- a/maidag/script.c +++ b/maidag/script.c @@ -120,12 +120,18 @@ apply_script (void *item, void *data) struct apply_script_closure *clos = data; char *progfile; int rc; + struct stat st; progfile = mu_expand_path_pattern (scr->pat, clos->auth->name); - if (access (progfile, R_OK)) + if (stat (progfile, &st)) { if (debug_level > 2) - mu_diag_output (MU_DIAG_DEBUG, _("Access to %s failed: %m"), progfile); + mu_diag_output (MU_DIAG_DEBUG, _("cannot stat %s: %s"), + progfile, mu_strerror (errno)); + else if (errno != ENOENT) + mu_diag_output (MU_DIAG_NOTICE, _("cannot stat %s: %s"), + progfile, mu_strerror (errno)); + free (progfile); return 0; } diff --git a/mailbox/mutil.c b/mailbox/mutil.c index df0b9f7..0712cb8 100644 --- a/mailbox/mutil.c +++ b/mailbox/mutil.c @@ -883,27 +883,30 @@ mu_expand_path_pattern (const char *pattern, const char *username) q += strlen (auth->dir); p++; } - else if (*p) - switch (*++p) - { - case 'u': - strcpy (q, username); - q += strlen (username); - break; + else if (*p == '%') + { + switch (*++p) + { + case 'u': + strcpy (q, username); + q += strlen (username); + break; - case 'h': - strcpy (q, auth->dir); - q += strlen (auth->dir); - break; + case 'h': + strcpy (q, auth->dir); + q += strlen (auth->dir); + break; - case '%': - *q++ = '%'; - break; + case '%': + *q++ = '%'; + break; - default: - *q++ = '%'; - *q++ = *p; - } + default: + *q++ = '%'; + *q++ = *p; + } + p++; + } } *q = 0; hooks/post-receive -- GNU Mailutils _______________________________________________ Commit-mailutils mailing list Commit-mailutils@gnu.org http://lists.gnu.org/mailman/listinfo/commit-mailutils