[dovecot-cvs] dovecot/src/imap-login client-authenticate.c, 1.35, 1.36 client.c, 1.42, 1.43

cras at dovecot.org cras at dovecot.org
Sat May 14 23:32:06 EEST 2005


Update of /var/lib/cvs/dovecot/src/imap-login
In directory talvi:/tmp/cvs-serv17364/src/imap-login

Modified Files:
	client-authenticate.c client.c 
Log Message:
Added configurable logging for login process. Added configurable pop3 logout
string. Based on a patch by Andrey Panin.



Index: client-authenticate.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/client-authenticate.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- client-authenticate.c	7 Jan 2005 17:29:25 -0000	1.35
+++ client-authenticate.c	14 May 2005 20:32:03 -0000	1.36
@@ -116,7 +116,9 @@
 		if (imap_proxy_new(client, host, port, destuser, pass) < 0)
 			client_destroy_internal_failure(client);
 		return TRUE;
-	} else if (host != NULL) {
+	}
+
+	if (host != NULL) {
 		/* IMAP referral
 
 		   [nologin] referral host=.. [port=..] [destuser=..]
@@ -142,6 +144,10 @@
 				   "this server instead.");
 		}
 		client_send_tagline(client, str_c(reply));
+		if (!nologin) {
+			client_destroy(client, "Login with referral");
+			return TRUE;
+		}
 	} else if (nologin) {
 		/* Authentication went ok, but for some reason user isn't
 		   allowed to log in. Shouldn't probably happen. */
@@ -158,16 +164,12 @@
 		return FALSE;
 	}
 
-	if (!nologin) {
-		client_destroy(client, t_strconcat(
-			"Login: ", client->common.virtual_user, NULL));
-	} else {
-		/* get back to normal client input. */
-		if (client->io != NULL)
-			io_remove(client->io);
-		client->io = io_add(client->common.fd, IO_READ,
-				    client_input, client);
-	}
+	i_assert(nologin);
+
+	/* get back to normal client input. */
+	if (client->io != NULL)
+		io_remove(client->io);
+	client->io = io_add(client->common.fd, IO_READ, client_input, client);
 	return TRUE;
 }
 
@@ -187,8 +189,7 @@
 		}
 
 		client_send_tagline(client, "OK Logged in.");
-		client_destroy(client, t_strconcat(
-			"Login: ", client->common.virtual_user, NULL));
+		client_destroy(client, "Login");
 		break;
 	case SASL_SERVER_REPLY_AUTH_FAILED:
 		if (args != NULL) {

Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/client.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- client.c	8 May 2005 17:16:28 -0000	1.42
+++ client.c	14 May 2005 20:32:03 -0000	1.43
@@ -43,6 +43,8 @@
 #  error client idle timeout must be smaller than authentication timeout
 #endif
 
+const char *login_protocol = "IMAP";
+
 static struct hash_table *clients;
 static struct timeout *to_idle;
 
@@ -443,7 +445,7 @@
 	client->destroyed = TRUE;
 
 	if (reason != NULL)
-		client_syslog(&client->common, "%s", reason);
+		client_syslog(&client->common, reason);
 
 	hash_remove(clients, client);
 
@@ -496,8 +498,7 @@
 {
 	client_send_line(client, "* BYE Internal login failure. "
 			 "Refer to server log for more information.");
-	client_destroy(client, t_strconcat("Internal login failure: ",
-					   client->common.virtual_user, NULL));
+	client_destroy(client, "Internal login failure");
 }
 
 void client_ref(struct imap_client *client)



More information about the dovecot-cvs mailing list