[dovecot-cvs] dovecot/src/login auth-connection.c,1.18,1.19 auth-connection.h,1.7,1.8 client-authenticate.c,1.31,1.32 client.c,1.26,1.27 client.h,1.11,1.12

cras at procontrol.fi cras at procontrol.fi
Thu Jan 9 14:19:09 EET 2003


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

Modified Files:
	auth-connection.c auth-connection.h client-authenticate.c 
	client.c client.h 
Log Message:
Log username with logins. auth/login processes are getting a bit kludgy..



Index: auth-connection.c
===================================================================
RCS file: /home/cvs/dovecot/src/login/auth-connection.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- auth-connection.c	6 Jan 2003 15:44:48 -0000	1.18
+++ auth-connection.c	9 Jan 2003 12:19:07 -0000	1.19
@@ -106,7 +106,7 @@
 	request->callback(request, request->conn->auth_process,
 			  AUTH_RESULT_INTERNAL_FAILURE,
 			  (const unsigned char *) "Authentication process died",
-			  0, request->context);
+			  0, NULL, request->context);
 	request_destroy(request);
 }
 
@@ -209,7 +209,7 @@
 	t_push();
 	request->callback(request, request->conn->auth_process,
 			  reply_data->result, data, reply_data->data_size,
-			  request->context);
+			  reply_data->virtual_user, request->context);
 	t_pop();
 
 	if (reply_data->result != AUTH_RESULT_CONTINUE)

Index: auth-connection.h
===================================================================
RCS file: /home/cvs/dovecot/src/login/auth-connection.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- auth-connection.h	6 Jan 2003 15:44:48 -0000	1.7
+++ auth-connection.h	9 Jan 2003 12:19:07 -0000	1.8
@@ -8,7 +8,8 @@
 typedef void (*AuthCallback)(struct auth_request *request,
 			     unsigned int auth_process, enum auth_result result,
 			     const unsigned char *reply_data,
-			     size_t reply_data_size, void *context);
+			     size_t reply_data_size, const char *virtual_user,
+			     void *context);
 
 struct auth_request {
         enum auth_mech mech;

Index: client-authenticate.c
===================================================================
RCS file: /home/cvs/dovecot/src/login/client-authenticate.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- client-authenticate.c	8 Jan 2003 23:55:44 -0000	1.31
+++ client-authenticate.c	9 Jan 2003 12:19:07 -0000	1.32
@@ -83,7 +83,8 @@
 
 	switch (result) {
 	case MASTER_RESULT_SUCCESS:
-		client_destroy(client, "Logged in.");
+		client_destroy(client, t_strconcat("Login: ",
+						   client->virtual_user, NULL));
 		client_unref(client);
 		break;
 	case MASTER_RESULT_INTERNAL_FAILURE:
@@ -117,7 +118,8 @@
 static int auth_callback(struct auth_request *request,
 			 unsigned int auth_process, enum auth_result result,
 			 const unsigned char *reply_data,
-			 size_t reply_data_size, void *context)
+			 size_t reply_data_size, const char *virtual_user,
+			 void *context)
 {
 	struct client *client = context;
 
@@ -129,6 +131,9 @@
 	case AUTH_RESULT_SUCCESS:
 		client->auth_request = NULL;
 
+		i_free(client->virtual_user);
+		client->virtual_user = i_strdup(virtual_user);
+
 		master_request_imap(client->fd, auth_process, client->cmd_tag,
 				    request->cookie, &client->ip,
 				    master_callback, client);
@@ -166,14 +171,15 @@
 static void login_callback(struct auth_request *request,
 			   unsigned int auth_process, enum auth_result result,
 			   const unsigned char *reply_data,
-			   size_t reply_data_size, void *context)
+			   size_t reply_data_size, const char *virtual_user,
+			   void *context)
 {
 	struct client *client = context;
 	const void *ptr;
 	size_t size;
 
 	if (auth_callback(request, auth_process, result,
-			  reply_data, reply_data_size, context)) {
+			  reply_data, reply_data_size, virtual_user, context)) {
                 ptr = buffer_get_data(client->plain_login, &size);
 		auth_continue_request(request, ptr, size);
 
@@ -231,12 +237,13 @@
 				  unsigned int auth_process,
 				  enum auth_result result,
 				  const unsigned char *reply_data,
-				  size_t reply_data_size, void *context)
+				  size_t reply_data_size,
+				  const char *virtual_user, void *context)
 {
 	struct client *client = context;
 
 	if (auth_callback(request, auth_process, result,
-			  reply_data, reply_data_size, context))
+			  reply_data, reply_data_size, virtual_user, context))
 		client_send_auth_data(client, reply_data, reply_data_size);
 }
 

Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/login/client.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- client.c	8 Jan 2003 23:55:44 -0000	1.26
+++ client.c	9 Jan 2003 12:19:07 -0000	1.27
@@ -14,8 +14,6 @@
 #include "client-authenticate.h"
 #include "ssl-proxy.h"
 
-#include <syslog.h>
-
 /* max. size of one parameter in line */
 #define MAX_INBUF_SIZE 512
 
@@ -357,6 +355,7 @@
 	net_disconnect(client->fd);
 	client->fd = -1;
 
+	i_free(client->virtual_user);
 	client_unref(client);
 }
 

Index: client.h
===================================================================
RCS file: /home/cvs/dovecot/src/login/client.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- client.h	8 Jan 2003 23:55:44 -0000	1.11
+++ client.h	9 Jan 2003 12:19:07 -0000	1.12
@@ -19,6 +19,7 @@
 
 	buffer_t *plain_login;
 	struct auth_request *auth_request;
+	char *virtual_user;
 
 	unsigned int tls:1;
 	unsigned int cmd_finished:1;




More information about the dovecot-cvs mailing list