dovecot: Added -k parameter to preserve environment. Normally ev...
dovecot at dovecot.org
dovecot at dovecot.org
Sun Sep 9 04:42:48 EEST 2007
details: http://hg.dovecot.org/dovecot/rev/7f6c99dc1f17
changeset: 6361:7f6c99dc1f17
user: Timo Sirainen <tss at iki.fi>
date: Sun Sep 09 04:42:42 2007 +0300
description:
Added -k parameter to preserve environment. Normally everything but TZ and
HOME are dropped.
diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
src/deliver/deliver.c | 8 ++++++--
diffs (39 lines):
diff -r 461ae76c84da -r 7f6c99dc1f17 src/deliver/deliver.c
--- a/src/deliver/deliver.c Sun Sep 09 04:33:45 2007 +0300
+++ b/src/deliver/deliver.c Sun Sep 09 04:42:42 2007 +0300
@@ -579,6 +579,7 @@ int main(int argc, char *argv[])
uid_t process_euid;
pool_t namespace_pool;
bool stderr_rejection = FALSE;
+ bool keep_environment = FALSE;
int i, ret;
i_set_failure_exit_callback(failure_exit_callback);
@@ -594,8 +595,6 @@ int main(int argc, char *argv[])
#ifdef SIGXFSZ
lib_signals_ignore(SIGXFSZ, TRUE);
#endif
-
- deliver_env_clean();
destination = NULL;
for (i = 1; i < argc; i++) {
@@ -617,6 +616,8 @@ int main(int argc, char *argv[])
"Missing config file path argument");
}
config_path = argv[i];
+ } else if (strcmp(argv[i], "-k") == 0) {
+ keep_environment = TRUE;
} else if (strcmp(argv[i], "-m") == 0) {
/* destination mailbox */
i++;
@@ -646,6 +647,9 @@ int main(int argc, char *argv[])
}
}
+ if (!keep_environment)
+ deliver_env_clean();
+
process_euid = geteuid();
if (destination != NULL)
user = destination;
More information about the dovecot-cvs
mailing list