[dovecot-cvs] dovecot/src/login auth-connection.c,1.17,1.18 auth-connection.h,1.6,1.7 client-authenticate.c,1.28,1.29

cras at procontrol.fi cras at procontrol.fi
Mon Jan 6 17:44:50 EET 2003


Update of /home/cvs/dovecot/src/login
In directory danu:/tmp/cvs-serv8500

Modified Files:
	auth-connection.c auth-connection.h client-authenticate.c 
Log Message:
If authentication was aborted by user, we didn't clean it up properly.



Index: auth-connection.c
===================================================================
RCS file: /home/cvs/dovecot/src/login/auth-connection.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- auth-connection.c	5 Jan 2003 15:19:50 -0000	1.17
+++ auth-connection.c	6 Jan 2003 15:44:48 -0000	1.18
@@ -333,6 +333,11 @@
 		auth_connection_destroy(request->conn);
 }
 
+void auth_abort_request(struct auth_request *request)
+{
+        request_destroy(request);
+}
+
 static void auth_connect_missing(void)
 {
 	DIR *dirp;

Index: auth-connection.h
===================================================================
RCS file: /home/cvs/dovecot/src/login/auth-connection.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- auth-connection.h	5 Jan 2003 15:19:50 -0000	1.6
+++ auth-connection.h	6 Jan 2003 15:44:48 -0000	1.7
@@ -31,6 +31,8 @@
 void auth_continue_request(struct auth_request *request,
 			   const unsigned char *data, size_t data_size);
 
+void auth_abort_request(struct auth_request *request);
+
 void auth_connection_init(void);
 void auth_connection_deinit(void);
 

Index: client-authenticate.c
===================================================================
RCS file: /home/cvs/dovecot/src/login/client-authenticate.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- client-authenticate.c	5 Jan 2003 15:19:50 -0000	1.28
+++ client-authenticate.c	6 Jan 2003 15:44:48 -0000	1.29
@@ -58,7 +58,10 @@
 
 static void client_auth_abort(struct client *client, const char *msg)
 {
-	client->auth_request = NULL;
+	if (client->auth_request != NULL) {
+		auth_abort_request(client->auth_request);
+		client->auth_request = NULL;
+	}
 
 	client_send_tagline(client, msg != NULL ? msg :
 			    "NO Authentication failed.");
@@ -138,6 +141,8 @@
 
 	case AUTH_RESULT_FAILURE:
 		/* see if we have error message */
+		client->auth_request = NULL;
+
 		if (reply_data_size > 0 &&
 		    reply_data[reply_data_size-1] == '\0') {
 			client_auth_abort(client, t_strconcat(
@@ -149,6 +154,8 @@
 		}
 		return FALSE;
 	default:
+		client->auth_request = NULL;
+
 		client_auth_abort(client, t_strconcat(
 			"NO Authentication failed: ", reply_data, NULL));
 		return FALSE;




More information about the dovecot-cvs mailing list