Mercurial > dovecot > core-2.2
changeset 12567:c9b3716e56f7
doveadm user: If user isn't found, exit with status 2.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 30 Dec 2010 11:51:59 +0200 |
parents | 89936539e3b8 |
children | 9216e5c861ee |
files | src/doveadm/doveadm-auth.c |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/doveadm-auth.c Fri Dec 17 13:23:07 2010 +0000 +++ b/src/doveadm/doveadm-auth.c Thu Dec 30 11:51:59 2010 +0200 @@ -65,7 +65,7 @@ } } auth_master_deinit(&conn); - return ret == 0 ? 1 : 0; + return ret; } static void @@ -250,15 +250,23 @@ 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); } }