From 456a8d49d8234cdd2d5e087cfb553502dba136b6 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 26 May 2010 19:33:16 +0100 Subject: [PATCH] doveadm auth: Fail if after password there is more parameters. --HG-- branch : HEAD --- src/doveadm/doveadm-auth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/doveadm/doveadm-auth.c b/src/doveadm/doveadm-auth.c index 3158ede5c9..effe664d0f 100644 --- a/src/doveadm/doveadm-auth.c +++ b/src/doveadm/doveadm-auth.c @@ -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) -- 2.47.3