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

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


details:   http://hg.dovecot.org/dovecot-1.1/rev/29e8867d3323
changeset: 8325:29e8867d3323
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jul 24 20:55:29 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 ec60b22595a9 -r 29e8867d3323 src/imap/main.c
--- a/src/imap/main.c	Tue Jul 21 15:18:49 2009 -0400
+++ b/src/imap/main.c	Fri Jul 24 20:55:29 2009 -0400
@@ -177,11 +177,15 @@ static void main_init(void)
         lib_signals_ignore(SIGALRM, FALSE);
 
 	user = getenv("USER");
+	if (user == NULL & IS_STANDALONE())
+		user = getlogin();
 	if (user == NULL) {
-		if (IS_STANDALONE())
-			user = getlogin();
-		if (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) {
diff -r ec60b22595a9 -r 29e8867d3323 src/pop3/main.c
--- a/src/pop3/main.c	Tue Jul 21 15:18:49 2009 -0400
+++ b/src/pop3/main.c	Fri Jul 24 20:55:29 2009 -0400
@@ -194,8 +194,14 @@ static int 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 pop3-login, "
+				"not pop3");
+		}
+	}
 
 	if (getenv("DEBUG") != NULL) {
 		const char *home;


More information about the dovecot-cvs mailing list