dovecot-2.0: doveadm: Mail commands assert-crashed when using -u...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Jun 21 23:55:27 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/407e7ff098ca
changeset: 11609:407e7ff098ca
user: Timo Sirainen <tss at iki.fi>
date: Mon Jun 21 21:55:24 2010 +0100
description:
doveadm: Mail commands assert-crashed when using -u wildcards.
diffstat:
src/doveadm/doveadm-mail.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diffs (47 lines):
diff -r d78370005268 -r 407e7ff098ca src/doveadm/doveadm-mail.c
--- a/src/doveadm/doveadm-mail.c Mon Jun 21 21:52:01 2010 +0100
+++ b/src/doveadm/doveadm-mail.c Mon Jun 21 21:55:24 2010 +0100
@@ -339,6 +339,7 @@
MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT;
struct doveadm_mail_cmd_context *ctx;
const char *getopt_args, *username, *wildcard_user;
+ bool iter_single_user;
int c;
if (doveadm_debug)
@@ -361,11 +362,6 @@
switch (c) {
case 'A':
ctx->iterate_all_users = TRUE;
- if (doveadm_print_is_initialized()) {
- doveadm_print_header("username", "Username",
- DOVEADM_PRINT_HEADER_FLAG_STICKY |
- DOVEADM_PRINT_HEADER_FLAG_HIDE_TITLE);
- }
break;
case 'u':
service_flags |=
@@ -382,15 +378,21 @@
}
}
argv += optind;
-
if (argv[0] != NULL && cmd->usage_args == NULL) {
i_fatal("doveadm %s: Unknown parameter: %s",
cmd->name, argv[0]);
}
+ iter_single_user = !ctx->iterate_all_users && wildcard_user == NULL;
+ if (doveadm_print_is_initialized() && !iter_single_user) {
+ doveadm_print_header("username", "Username",
+ DOVEADM_PRINT_HEADER_FLAG_STICKY |
+ DOVEADM_PRINT_HEADER_FLAG_HIDE_TITLE);
+ }
+
ctx->v.init(ctx, (const void *)argv);
- if (!ctx->iterate_all_users && wildcard_user == NULL) {
+ if (iter_single_user) {
doveadm_mail_single_user(ctx, username, service_flags);
} else {
service_flags |= MAIL_STORAGE_SERVICE_FLAG_TEMP_PRIV_DROP;
More information about the dovecot-cvs
mailing list