From: Timo Sirainen Date: Thu, 30 Dec 2010 09:51:59 +0000 (+0200) Subject: doveadm user: If user isn't found, exit with status 2. X-Git-Tag: 2.0.9~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f827f6b7ea83e8e748f2b6aad90e6a2050c58e86;p=thirdparty%2Fdovecot%2Fcore.git doveadm user: If user isn't found, exit with status 2. --- diff --git a/src/doveadm/doveadm-auth.c b/src/doveadm/doveadm-auth.c index efc4eafd72..a7c02cddd6 100644 --- a/src/doveadm/doveadm-auth.c +++ b/src/doveadm/doveadm-auth.c @@ -65,7 +65,7 @@ cmd_user_input(const char *auth_socket_path, const struct authtest_input *input) } } auth_master_deinit(&conn); - return ret == 0 ? 1 : 0; + return ret; } static void @@ -250,15 +250,23 @@ auth_cmd_common(const struct doveadm_cmd *cmd, int argc, char *argv[]) cmd_user_list(auth_socket_path, argv + optind); } else { bool first = TRUE; + bool notfound = FALSE; while ((input.username = argv[optind++]) != NULL) { if (first) first = FALSE; else putchar('\n'); - if (cmd_user_input(auth_socket_path, &input) < 0) + switch (cmd_user_input(auth_socket_path, &input)) { + case -1: exit(1); + case 0: + notfound = TRUE; + break; + } } + if (notfound) + exit(2); } }