changeset 10455:6c9d97878efe HEAD

*-login: Check for missing username in lib-master code.
author Timo Sirainen <tss@iki.fi>
date Fri, 11 Dec 2009 16:00:14 -0500
parents 802b9ebe79e6
children f0fd3bd7c122
files src/imap/main.c src/lib-master/master-login.c src/pop3/main.c
diffstat 3 files changed, 3 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/main.c	Fri Dec 11 14:33:58 2009 -0500
+++ b/src/imap/main.c	Fri Dec 11 16:00:14 2009 -0500
@@ -224,12 +224,6 @@
 	input.username = username;
 	input.userdb_fields = extra_fields;
 
-	if (input.username == NULL) {
-		i_error("login client: Username missing from auth reply");
-		(void)close(client->fd);
-		return;
-	}
-
 	buffer_create_const_data(&input_buf, client->data,
 				 client->auth_req.data_size);
 	if (client_create_from_input(&input, client->fd, client->fd,
--- a/src/lib-master/master-login.c	Fri Dec 11 14:33:58 2009 -0500
+++ b/src/lib-master/master-login.c	Fri Dec 11 16:00:14 2009 -0500
@@ -142,7 +142,9 @@
 	reply.mail_pid = getpid();
 	o_stream_send(conn->output, &reply, sizeof(reply));
 
-	if (auth_args == NULL) {
+	if (auth_args == NULL || auth_args[0] == NULL) {
+		if (auth_args != NULL)
+			i_error("login client: Username missing from auth reply");
 		if (close(client->fd) < 0)
 			i_error("close(fd_read client) failed: %m");
 		i_free(client);
--- a/src/pop3/main.c	Fri Dec 11 14:33:58 2009 -0500
+++ b/src/pop3/main.c	Fri Dec 11 16:00:14 2009 -0500
@@ -150,12 +150,6 @@
 	input.username = username;
 	input.userdb_fields = extra_fields;
 
-	if (input.username == NULL) {
-		i_error("login client: Username missing from auth reply");
-		(void)close(client->fd);
-		return;
-	}
-
 	buffer_create_const_data(&input_buf, client->data,
 				 client->auth_req.data_size);
 	if (client_create_from_input(&input, client->fd, client->fd,