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

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 5 14:06:05 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/2918bfacf565
changeset: 16205:2918bfacf565
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 b6f69bdcf63f -r 2918bfacf565 src/doveadm/doveadm-mail-batch.c
--- a/src/doveadm/doveadm-mail-batch.c	Fri Apr 05 13:19:17 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