[dovecot-cvs] dovecot-lda/src deliver.c,1.47,1.48
cras at dovecot.org
cras at dovecot.org
Fri Apr 28 16:48:33 EEST 2006
Update of /var/lib/cvs/dovecot-lda/src
In directory talvi:/tmp/cvs-serv60
Modified Files:
deliver.c
Log Message:
Remove all environment but TZ and HOME before doing anything so the existing
environment doesn't mess up settings (especially MAIL).
Index: deliver.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/deliver.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- deliver.c 20 Apr 2006 16:17:30 -0000 1.47
+++ deliver.c 28 Apr 2006 13:48:30 -0000 1.48
@@ -509,7 +509,7 @@
{
const char *config_path = DEFAULT_CONFIG_FILE;
const char *mailbox = "INBOX";
- const char *auth_socket;
+ const char *auth_socket, *env_tz;
const char *home, *destination, *mail_env, *str, *script_path;
const struct var_expand_table *table;
enum mail_storage_flags flags;
@@ -530,6 +530,15 @@
lib_signals_set_handler(SIGPIPE, FALSE, NULL, NULL);
lib_signals_set_handler(SIGALRM, FALSE, NULL, NULL);
+ /* Clean up environment. */
+ env_tz = getenv("TZ");
+ home = getenv("HOME");
+ env_clean();
+ if (env_tz != NULL)
+ env_put(t_strconcat("TZ=", env_tz, NULL));
+ if (home != NULL)
+ env_put(t_strconcat("HOME=", home, NULL));
+
destination = NULL;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-d") == 0) {
More information about the dovecot-cvs
mailing list