[dovecot-cvs] dovecot/src/pop3-login client-authenticate.c, 1.34, 1.35 client.c, 1.29, 1.30 client.h, 1.12, 1.13

cras at dovecot.org cras at dovecot.org
Mon Oct 18 02:08:43 EEST 2004


Update of /var/lib/cvs/dovecot/src/pop3-login
In directory talvi:/tmp/cvs-serv21845

Modified Files:
	client-authenticate.c client.c client.h 
Log Message:
tls/secured variables are in common client structure. Plaintext logins
didn't work because of this when disable_plaintext_auth = yes, even if SSL
was used.



Index: client-authenticate.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/client-authenticate.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- client-authenticate.c	17 Oct 2004 15:15:27 -0000	1.34
+++ client-authenticate.c	17 Oct 2004 23:08:40 -0000	1.35
@@ -32,18 +32,18 @@
 		   c) we allow insecure authentication
 		*/
 		if ((mech[i].flags & MECH_SEC_PRIVATE) == 0 &&
-		    (client->secured || disable_plaintext_auth ||
+		    (client->common.secured || disable_plaintext_auth ||
 		     (mech[i].flags & MECH_SEC_PLAINTEXT) == 0)) {
 			str_append_c(str, ' ');
 			str_append(str, mech[i].name);
 		}
 	}
 
-	client_send_line(client, t_strconcat("+OK\r\n" POP3_CAPABILITY_REPLY,
-					     (ssl_initialized && !client->tls) ?
-					     "STLS\r\n" : "",
-					     str_c(str),
-					     "\r\n.", NULL));
+	client_send_line(client,
+			 t_strconcat("+OK\r\n" POP3_CAPABILITY_REPLY,
+				     (ssl_initialized && !client->common.tls) ?
+				     "STLS\r\n" : "",
+				     str_c(str), "\r\n.", NULL));
 	return TRUE;
 }
 
@@ -149,7 +149,7 @@
 		mech = auth_client_get_available_mechs(auth_client, &count);
 		for (i = 0; i < count; i++) {
 			if ((mech[i].flags & MECH_SEC_PRIVATE) == 0 &&
-			    (client->secured || disable_plaintext_auth ||
+			    (client->common.secured || disable_plaintext_auth ||
 			     (mech[i].flags & MECH_SEC_PLAINTEXT) == 0))
 		 		client_send_line(client, mech[i].name);
 		}
@@ -183,7 +183,7 @@
 
 int cmd_user(struct pop3_client *client, const char *args)
 {
-	if (!client->secured && disable_plaintext_auth) {
+	if (!client->common.secured && disable_plaintext_auth) {
 		if (verbose_auth) {
 			client_syslog(&client->common, "Login failed: "
 				      "Plaintext authentication disabled");

Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/client.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- client.c	11 Oct 2004 17:14:28 -0000	1.29
+++ client.c	17 Oct 2004 23:08:40 -0000	1.30
@@ -54,8 +54,8 @@
 	if (addr == NULL)
 		addr = "??";
 
-	process_title_set(t_strdup_printf(client->tls ? "[%s TLS]" : "[%s]",
-					  addr));
+	process_title_set(t_strdup_printf(client->common.tls ?
+					  "[%s TLS]" : "[%s]", addr));
 }
 
 static void client_open_streams(struct pop3_client *client, int fd)
@@ -78,8 +78,8 @@
 		return;
 	}
 
-	client->tls = TRUE;
-	client->secured = TRUE;
+	client->common.tls = TRUE;
+	client->common.secured = TRUE;
 	client_set_title(client);
 
 	client->common.fd = fd_ssl;
@@ -107,7 +107,7 @@
 
 static int cmd_stls(struct pop3_client *client)
 {
-	if (client->tls) {
+	if (client->common.tls) {
 		client_send_line(client, "-ERR TLS is already active.");
 		return TRUE;
 	}
@@ -307,10 +307,10 @@
 	client = i_new(struct pop3_client, 1);
 	client->created = ioloop_time;
 	client->refcount = 1;
-	client->tls = ssl;
+	client->common.tls = ssl;
 
         addr = net_ip2addr(ip);
-	client->secured = ssl ||
+	client->common.secured = ssl ||
 		(IPADDR_IS_V4(ip) && strncmp(addr, "127.", 4) == 0) ||
 		(IPADDR_IS_V6(ip) && strcmp(addr, "::1") == 0);
 

Index: client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/client.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- client.h	11 Oct 2004 17:14:28 -0000	1.12
+++ client.h	17 Oct 2004 23:08:40 -0000	1.13
@@ -24,8 +24,6 @@
 	char *apop_challenge;
 	struct auth_connect_id auth_id;
 
-	unsigned int tls:1;
-	unsigned int secured:1;
 	unsigned int authenticating:1;
 	unsigned int auth_connected:1;
 	unsigned int destroyed:1;



More information about the dovecot-cvs mailing list