dovecot-2.2: doveadm-server: Using any command line parameters c...

dovecot at dovecot.org dovecot at dovecot.org
Tue Apr 15 15:33:52 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/24e1b79e0d3d
changeset: 17215:24e1b79e0d3d
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Apr 15 17:33:12 2014 +0200
description:
doveadm-server: Using any command line parameters caused crashes due to missing getopt() reset.

diffstat:

 src/doveadm/client-connection.c |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r b9bc20b1ef91 -r 24e1b79e0d3d src/doveadm/client-connection.c
--- a/src/doveadm/client-connection.c	Tue Apr 15 17:20:02 2014 +0200
+++ b/src/doveadm/client-connection.c	Tue Apr 15 17:33:12 2014 +0200
@@ -54,6 +54,7 @@
 	if (doveadm_debug)
 		ctx->service_flags |= MAIL_STORAGE_SERVICE_FLAG_DEBUG;
 
+	optind = 1;
 	getopt_args = t_strconcat("AS:u:", ctx->getopt_args, NULL);
 	while ((c = getopt(argc, argv, getopt_args)) > 0) {
 		switch (c) {
@@ -80,9 +81,7 @@
 			}
 		}
 	}
-
 	argv += optind;
-	optind = 1;
 
 	if (argv[0] != NULL && cmd->usage_args == NULL) {
 		i_error("doveadm %s: Client sent unknown parameter: %s",


More information about the dovecot-cvs mailing list