[dovecot-cvs] dovecot/src/imap-login client-authenticate.c, 1.17, 1.18 client.c, 1.24, 1.25 client.h, 1.7, 1.8

cras at procontrol.fi cras at procontrol.fi
Sun May 30 07:41:29 EEST 2004


Update of /home/cvs/dovecot/src/imap-login
In directory talvi:/tmp/cvs-serv22440

Modified Files:
	client-authenticate.c client.c client.h 
Log Message:
Use initial SASL response for LOGIN command internally.



Index: client-authenticate.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap-login/client-authenticate.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- a/client-authenticate.c	29 May 2004 21:40:30 -0000	1.17
+++ b/client-authenticate.c	30 May 2004 04:41:27 -0000	1.18
@@ -113,17 +113,11 @@
 	switch (auth_callback(request, reply, data, &client->common,
 			      master_callback, &error)) {
 	case -1:
+	case 0:
 		/* login failed */
 		client_auth_abort(client, error);
 		break;
 
-	case 0:
-		/* continue */
-		ptr = buffer_get_data(client->plain_login, &size);
-		auth_client_request_continue(request, ptr, size);
-
-		buffer_set_used_size(client->plain_login, 0);
-		break;
 	default:
 		/* success, we should be able to log in. if we fail, just
 		   disconnect the client. */
@@ -147,6 +141,7 @@
 int cmd_login(struct imap_client *client, struct imap_arg *args)
 {
 	const char *user, *pass, *error;
+	string_t *str;
 
 	/* two arguments: username and password */
 	if (args[0].type != IMAP_ARG_ATOM && args[0].type != IMAP_ARG_STRING)
@@ -170,18 +165,19 @@
 	}
 
 	/* authorization ID \0 authentication ID \0 pass */
-	buffer_set_used_size(client->plain_login, 0);
-	buffer_append_c(client->plain_login, '\0');
-	buffer_append(client->plain_login, user, strlen(user));
-	buffer_append_c(client->plain_login, '\0');
-	buffer_append(client->plain_login, pass, strlen(pass));
+	str = t_str_new(64);
+	str_append_c(str, '\0');
+	str_append(str, user);
+	str_append_c(str, '\0');
+	str_append(str, pass);
 
 	client_ref(client);
 
 	client->common.auth_request =
 		auth_client_request_new(auth_client, "PLAIN", "IMAP",
 					client_get_auth_flags(client),
-					NULL, 0, login_callback,
+					str_data(str), str_len(str),
+					login_callback,
 					client, &error);
 	if (client->common.auth_request == NULL) {
 		client_send_tagline(client, t_strconcat(

Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap-login/client.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- a/client.c	24 May 2004 22:35:55 -0000	1.24
+++ b/client.c	30 May 2004 04:41:27 -0000	1.25
@@ -378,7 +378,6 @@
 
 	client_open_streams(client, fd);
 	client->common.io = io_add(fd, IO_READ, client_input, client);
-	client->plain_login = buffer_create_dynamic(system_pool, 128, 8192);
 
 	client->last_input = ioloop_time;
 	hash_insert(clients, client, client);
@@ -442,7 +441,6 @@
 	i_stream_unref(client->input);
 	o_stream_unref(client->output);
 
-	buffer_free(client->plain_login);
 	i_free(client->common.virtual_user);
 	i_free(client);
 

Index: client.h
===================================================================
RCS file: /home/cvs/dovecot/src/imap-login/client.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- a/client.h	24 Aug 2003 07:55:23 -0000	1.7
+++ b/client.h	30 May 2004 04:41:27 -0000	1.8
@@ -20,8 +20,6 @@
 
 	const char *cmd_tag, *cmd_name;
 
-	buffer_t *plain_login;
-
 	unsigned int tls:1;
 	unsigned int secured:1;
 	unsigned int cmd_finished:1;



More information about the dovecot-cvs mailing list