dovecot-2.1: doveadm batch: Fixed handling subcommand parameters...

dovecot at dovecot.org dovecot at dovecot.org
Wed Apr 10 14:18:44 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.1/rev/850b5d8bbcc9
changeset: 14953:850b5d8bbcc9
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Apr 05 14:05:54 2013 +0300
description:
doveadm batch: Fixed handling subcommand parameters and errors.

diffstat:

 src/doveadm/doveadm-mail-batch.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r c6b4a639cae1 -r 850b5d8bbcc9 src/doveadm/doveadm-mail-batch.c
--- a/src/doveadm/doveadm-mail-batch.c	Fri Apr 05 13:21:40 2013 +0300
+++ b/src/doveadm/doveadm-mail-batch.c	Fri Apr 05 14:05:54 2013 +0300
@@ -37,10 +37,14 @@
 	int ret = 0;
 
 	array_foreach(&ctx->commands, cmdp) {
+		(*cmdp)->cur_mail_user = user;
 		if ((*cmdp)->v.run(*cmdp, user) < 0) {
+			i_assert((*cmdp)->exit_code != 0);
+			_ctx->exit_code = (*cmdp)->exit_code;
 			ret = -1;
 			break;
 		}
+		(*cmdp)->cur_mail_user = NULL;
 	}
 	return ret;
 }
@@ -149,6 +153,7 @@
 	struct batch_cmd_context *ctx;
 
 	ctx = doveadm_mail_cmd_alloc(struct batch_cmd_context);
+	ctx->ctx.getopt_args = "+"; /* disable processing -args in the middle */
 	ctx->ctx.v.preinit = cmd_batch_preinit;
 	ctx->ctx.v.init = cmd_batch_init;
 	ctx->ctx.v.prerun = cmd_batch_prerun;


More information about the dovecot-cvs mailing list