]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm auth: Fail if after password there is more parameters.
authorTimo Sirainen <tss@iki.fi>
Wed, 26 May 2010 18:33:16 +0000 (19:33 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 26 May 2010 18:33:16 +0000 (19:33 +0100)
--HG--
branch : HEAD

src/doveadm/doveadm-auth.c

index 3158ede5c92f7431459601df4098e89af650c8df..effe664d0fa0a26bc6e4a28bf5c2bc2d4bb2ed43 100644 (file)
@@ -195,8 +195,10 @@ auth_cmd_common(const struct doveadm_cmd *cmd, int argc, char *argv[])
 
        if (cmd == &doveadm_cmd_auth) {
                input.username = argv[optind++];
-               input.password = argv[optind] != NULL ? argv[optind] :
+               input.password = argv[optind] != NULL ? argv[optind++] :
                        t_askpass("Password: ");
+               if (argv[optind] != NULL)
+                       i_fatal("Unexpected parameter: %s", argv[optind]);
                if (cmd_auth_input(auth_socket_path, &input) < 0)
                        exit(FATAL_DEFAULT);
                if (!input.success)