dovecot-1.2: expire-tool: Clear only user-specific environment v...

dovecot at dovecot.org dovecot at dovecot.org
Mon May 18 04:36:24 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/249554df412f
changeset: 9055:249554df412f
user:      Timo Sirainen <tss at iki.fi>
date:      Sun May 17 21:04:26 2009 -0400
description:
expire-tool: Clear only user-specific environment variables when changing users.

diffstat:

1 file changed, 6 insertions(+), 1 deletion(-)
src/plugins/expire/expire-tool.c |    7 ++++++-

diffs (36 lines):

diff -r 89de2b91a655 -r 249554df412f src/plugins/expire/expire-tool.c
--- a/src/plugins/expire/expire-tool.c	Sun May 17 21:03:39 2009 -0400
+++ b/src/plugins/expire/expire-tool.c	Sun May 17 21:04:26 2009 -0400
@@ -36,12 +36,13 @@ struct expire_context {
 
 uid_t global_mail_uid;
 gid_t global_mail_gid;
+static struct env_backup *env_backup;
 
 static int user_init(struct expire_context *ctx, const char *user)
 {
 	int ret;
 
-	env_clean();
+	env_backup_restore(env_backup);
 	if ((ret = auth_client_put_user_env(ctx->auth_conn, user)) <= 0) {
 		if (ret < 0)
 			return ret;
@@ -254,6 +255,8 @@ static void expire_run(bool testrun)
 	if (dict == NULL)
 		i_fatal("dict_init() failed");
 
+	env_backup = env_backup_save();
+
 	trans = dict_transaction_begin(dict);
 	iter = dict_iterate_init(dict, DICT_EXPIRE_PREFIX,
 				 DICT_ITERATE_FLAG_RECURSE |
@@ -327,6 +330,8 @@ static void expire_run(bool testrun)
 			}
 		}
 	}
+	env_backup_free(&env_backup);
+
 	dict_iterate_deinit(&iter);
 	if (!testrun)
 		dict_transaction_commit(&trans);


More information about the dovecot-cvs mailing list