From: Timo Sirainen Date: Mon, 29 Nov 2010 23:58:19 +0000 (+0000) Subject: lmtp: Recent change broke accessing mail_temp_dir. X-Git-Tag: 2.0.8~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4afd50dff16661684ad2acddad7284bcd8c564db;p=thirdparty%2Fdovecot%2Fcore.git lmtp: Recent change broke accessing mail_temp_dir. Also when it happened, an error message wasn't always logged. --- diff --git a/src/lmtp/client.c b/src/lmtp/client.c index 8039dd239b..16bff8b4ed 100644 --- a/src/lmtp/client.c +++ b/src/lmtp/client.c @@ -163,7 +163,7 @@ static void client_read_settings(struct client *client) &set_parser, &error) < 0) i_fatal("%s", error); - lmtp_settings_dup(set_parser, client->pool, &client->user_set, + lmtp_settings_dup(set_parser, client->pool, &client->lmtp_set, &client->set); } diff --git a/src/lmtp/client.h b/src/lmtp/client.h index 8f4072fa6f..522fe91fe2 100644 --- a/src/lmtp/client.h +++ b/src/lmtp/client.h @@ -45,7 +45,6 @@ struct client { const struct setting_parser_info *user_set_info; const struct lda_settings *set; const struct lmtp_settings *lmtp_set; - const struct mail_user_settings *user_set; int fd_in, fd_out; struct io *io; struct istream *input; diff --git a/src/lmtp/commands.c b/src/lmtp/commands.c index ccc376c2cd..ba5cedbb37 100644 --- a/src/lmtp/commands.c +++ b/src/lmtp/commands.c @@ -757,10 +757,12 @@ static int client_input_add_file(struct client *client, /* move everything to a temporary file. */ path = t_str_new(256); - mail_user_set_get_temp_prefix(path, client->user_set); + mail_user_set_get_temp_prefix(path, client->raw_mail_user->set); fd = safe_mkstemp_hostpid(path, 0600, (uid_t)-1, (gid_t)-1); - if (fd == -1) + if (fd == -1) { + i_error("Temp file creation to %s failed: %m", str_c(path)); return -1; + } /* we just want the fd, unlink it */ if (unlink(str_c(path)) < 0) { diff --git a/src/lmtp/lmtp-settings.c b/src/lmtp/lmtp-settings.c index 9f0ec5edd9..f55895b300 100644 --- a/src/lmtp/lmtp-settings.c +++ b/src/lmtp/lmtp-settings.c @@ -2,6 +2,7 @@ #include "lib.h" #include "buffer.h" +#include "var-expand.h" #include "settings-parser.h" #include "service-settings.h" #include "master-service.h" @@ -85,14 +86,12 @@ const struct setting_parser_info lmtp_setting_parser_info = { void lmtp_settings_dup(const struct setting_parser_context *set_parser, pool_t pool, - const struct mail_user_settings **user_set_r, const struct lmtp_settings **lmtp_set_r, const struct lda_settings **lda_set_r) { void **sets; sets = settings_parser_get_list(set_parser) + 1; - *user_set_r = settings_dup(&mail_user_setting_parser_info, sets[0], pool); *lda_set_r = settings_dup(&lda_setting_parser_info, sets[1], pool); *lmtp_set_r = settings_dup(&lmtp_setting_parser_info, sets[2], pool); } diff --git a/src/lmtp/lmtp-settings.h b/src/lmtp/lmtp-settings.h index b0e859631d..58600060c0 100644 --- a/src/lmtp/lmtp-settings.h +++ b/src/lmtp/lmtp-settings.h @@ -12,7 +12,6 @@ extern const struct setting_parser_info lmtp_setting_parser_info; void lmtp_settings_dup(const struct setting_parser_context *set_parser, pool_t pool, - const struct mail_user_settings **user_set_r, const struct lmtp_settings **lmtp_set_r, const struct lda_settings **lda_set_r);