dovecot-2.0: doveadm user: If user isn't found, exit with status 2.

dovecot at dovecot.org dovecot at dovecot.org
Thu Dec 30 11:52:23 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/c9b3716e56f7
changeset: 12529:c9b3716e56f7
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Dec 30 11:51:59 2010 +0200
description:
doveadm user: If user isn't found, exit with status 2.

diffstat:

 src/doveadm/doveadm-auth.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (37 lines):

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);
 	}
 }
 


More information about the dovecot-cvs mailing list