dovecot-1.0: dovecot-auth: Give a nice error message if you try ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Aug 5 03:38:27 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.0/rev/2d0520777c4b
changeset: 5566:2d0520777c4b
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 04 20:38:20 2008 -0400
description:
dovecot-auth: Give a nice error message if you try to run it manually.

diffstat:

1 file changed, 9 insertions(+), 9 deletions(-)
src/auth/main.c |   18 +++++++++---------

diffs (36 lines):

diff -r 2298061b424a -r 2d0520777c4b src/auth/main.c
--- a/src/auth/main.c	Sun Jul 20 19:27:09 2008 +0300
+++ b/src/auth/main.c	Mon Aug 04 20:38:20 2008 -0400
@@ -181,6 +181,14 @@ static void add_extra_listeners(void)
 
 static void drop_privileges(void)
 {
+ 	standalone = getenv("DOVECOT_MASTER") == NULL;
+ 	if (standalone && getenv("AUTH_1") == NULL) {
+ 		i_fatal("dovecot-auth is usually started through "
+ 			"dovecot master process. If you wish to run "
+ 			"it standalone, you'll need to set AUTH_* "
+ 			"environment variables (AUTH_1 isn't set).");
+ 	}
+
 	open_logfile();
 
 	/* Open /dev/urandom before chrooting */
@@ -237,16 +245,8 @@ static void main_init(bool nodaemon)
 		return;
 	}
 
-	standalone = getenv("DOVECOT_MASTER") == NULL;
-	if (standalone) {
+	if (getenv("DOVECOT_MASTER") == NULL) {
 		/* starting standalone */
-		if (getenv("AUTH_1") == NULL) {
-			i_fatal("dovecot-auth is usually started through "
-				"dovecot master process. If you wish to run "
-				"it standalone, you'll need to set AUTH_* "
-				"environment variables (AUTH_1 isn't set).");
-		}
-
 		if (!nodaemon) {
 			switch (fork()) {
 			case -1:


More information about the dovecot-cvs mailing list