dovecot-1.2: If login_executable=imap/pop3, give better error me...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jul 25 03:55:41 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/1eb00fd62d1c
changeset: 9238:1eb00fd62d1c
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jul 24 20:55:26 2009 -0400
description:
If login_executable=imap/pop3, give better error message.

diffstat:

2 files changed, 15 insertions(+), 5 deletions(-)
src/imap/main.c |   10 +++++++---
src/pop3/main.c |   10 ++++++++--

diffs (42 lines):

diff -r 72f159e0aaa6 -r 1eb00fd62d1c src/imap/main.c
--- a/src/imap/main.c	Fri Jul 24 16:02:03 2009 -0400
+++ b/src/imap/main.c	Fri Jul 24 20:55:26 2009 -0400
@@ -179,11 +179,15 @@ static void main_init(void)
         lib_signals_ignore(SIGALRM, FALSE);
 
 	username = getenv("USER");
+	if (username == NULL & IS_STANDALONE())
+		username = getlogin();
 	if (username == NULL) {
-		if (IS_STANDALONE())
-			username = getlogin();
-		if (username == NULL)
+		if (getenv("DOVECOT_MASTER") == NULL)
 			i_fatal("USER environment missing");
+		else {
+			i_fatal("login_executable setting must be imap-login, "
+				"not imap");
+		}
 	}
 
 	home = getenv("HOME");
diff -r 72f159e0aaa6 -r 1eb00fd62d1c src/pop3/main.c
--- a/src/pop3/main.c	Fri Jul 24 16:02:03 2009 -0400
+++ b/src/pop3/main.c	Fri Jul 24 20:55:26 2009 -0400
@@ -198,8 +198,14 @@ static bool main_init(void)
         lib_signals_ignore(SIGPIPE, TRUE);
         lib_signals_ignore(SIGALRM, FALSE);
 
-	if (getenv("USER") == NULL)
-		i_fatal("USER environment missing");
+	if (getenv("USER") == NULL) {
+		if (getenv("DOVECOT_MASTER") == NULL)
+			i_fatal("USER environment missing");
+		else {
+			i_fatal("login_executable setting must be imap-login, "
+				"not imap");
+		}
+	}
 
 	if (getenv("DEBUG") != NULL) {
 		const char *home;


More information about the dovecot-cvs mailing list