[dovecot-cvs] dovecot/src/imap-login client.c,1.51,1.52

cras at dovecot.org cras at dovecot.org
Sat Jul 1 23:09:39 EEST 2006


Update of /var/lib/cvs/dovecot/src/imap-login
In directory talvi:/tmp/cvs-serv3701/src/imap-login

Modified Files:
	client.c 
Log Message:
Removed hardcoded 127.* and ::1 IP checks. Instead just check that local IP 
matches remote IP to assume the connection is secure.     



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/client.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- client.c	14 Apr 2006 18:20:54 -0000	1.51
+++ client.c	1 Jul 2006 20:09:37 -0000	1.52
@@ -411,7 +411,6 @@
 			     const struct ip_addr *ip)
 {
 	struct imap_client *client;
-	const char *addr;
 
 	if (max_logging_users > CLIENT_DESTROY_OLDEST_COUNT &&
 	    hash_size(clients) >= max_logging_users) {
@@ -427,12 +426,7 @@
 	client->created = ioloop_time;
 	client->refcount = 1;
 	client->common.tls = ssl;
-
-        addr = net_ip2addr(ip);
-	client->common.secured = ssl ||
-		(IPADDR_IS_V4(ip) && strncmp(addr, "127.", 4) == 0) ||
-		(IPADDR_IS_V6(ip) && (strcmp(addr, "::1") == 0 ||
-				      strncmp(addr, "::ffff:127.", 11) == 0));
+	client->common.secured = ssl || net_ip_compare(ip, local_ip);
 
 	client->common.local_ip = *local_ip;
 	client->common.ip = *ip;



More information about the dovecot-cvs mailing list