# HG changeset patch # User Timo Sirainen # Date 1293702719 -7200 # Node ID c9b3716e56f75a2b68d686eb035143a5e547724d # Parent 89936539e3b83e27297648cf3a5352fdb5d8ea62 doveadm user: If user isn't found, exit with status 2. diff -r 89936539e3b8 -r c9b3716e56f7 src/doveadm/doveadm-auth.c --- 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); } }