changeset 912:ee0b3d18edd4 HEAD

If authentication was aborted by user, we didn't clean it up properly.
author Timo Sirainen <tss@iki.fi>
date Mon, 06 Jan 2003 17:44:48 +0200
parents 7f92d2100795
children f8e189e8a98e
files src/login/auth-connection.c src/login/auth-connection.h src/login/client-authenticate.c
diffstat 3 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/login/auth-connection.c	Mon Jan 06 17:09:13 2003 +0200
+++ b/src/login/auth-connection.c	Mon Jan 06 17:44:48 2003 +0200
@@ -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;
--- a/src/login/auth-connection.h	Mon Jan 06 17:09:13 2003 +0200
+++ b/src/login/auth-connection.h	Mon Jan 06 17:44:48 2003 +0200
@@ -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);
 
--- a/src/login/client-authenticate.c	Mon Jan 06 17:09:13 2003 +0200
+++ b/src/login/client-authenticate.c	Mon Jan 06 17:44:48 2003 +0200
@@ -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;