dovecot-2.0: master: Use env_clean_except() instead of doing it ...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Oct 25 19:34:15 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/d1fd5b84d410
changeset: 12349:d1fd5b84d410
user: Timo Sirainen <tss at iki.fi>
date: Mon Oct 25 17:34:10 2010 +0100
description:
master: Use env_clean_except() instead of doing it ourself.
diffstat:
src/master/main.c | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diffs (40 lines):
diff -r e0a97842182f -r d1fd5b84d410 src/master/main.c
--- a/src/master/main.c Mon Oct 25 17:31:39 2010 +0100
+++ b/src/master/main.c Mon Oct 25 17:34:10 2010 +0100
@@ -598,6 +598,11 @@
int main(int argc, char *argv[])
{
+ static const char *preserve_envs[] = {
+ /* AIX depends on TZ to get the timezone correctly. */
+ "TZ",
+ NULL
+ };
struct master_settings *set;
unsigned int child_process_env_idx = 0;
const char *error, *env_tz, *doveconf_arg = NULL;
@@ -728,19 +733,13 @@
master_settings_do_fixes(set);
fatal_log_check(set);
- /* save TZ environment. AIX depends on it to get the timezone
- correctly. */
+ /* clean up the environment */
+ env_clean_except(preserve_envs);
+
env_tz = getenv("TZ");
-
- /* clean up the environment of everything */
- env_clean();
-
- /* put back the TZ */
if (env_tz != NULL) {
- const char *env = t_strconcat("TZ=", env_tz, NULL);
-
- env_put(env);
- child_process_env[child_process_env_idx++] = env;
+ child_process_env[child_process_env_idx++] =
+ t_strconcat("TZ=", env_tz, NULL);
}
i_assert(child_process_env_idx <
sizeof(child_process_env) / sizeof(child_process_env[0]));
More information about the dovecot-cvs
mailing list