pidgin: 840e5251: Send * as our local hostname for the USE...

elb at pidgin.im elb at pidgin.im
Sun Apr 3 16:32:27 EDT 2011


----------------------------------------------------------------------
Revision: 840e5251829610a4d5500832438e6086f442148c
Parent:   570b107a62822dd538074753d93b576dea0043a3
Author:   elb at pidgin.im
Date:     04/03/11 16:21:22
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/840e5251829610a4d5500832438e6086f442148c

Changelog: 

Send * as our local hostname for the USER message at signon.

This value is ignored by most servers anyway, and could disclose
location information for users connecting via Tor, through VPNs, or
via other proxying systems.

References #8322

Changes against parent 570b107a62822dd538074753d93b576dea0043a3

  patched  libpurple/protocols/irc/irc.c

-------------- next part --------------
============================================================
--- libpurple/protocols/irc/irc.c	a7dd36a573f3e22b836727e3e2790521901e8950
+++ libpurple/protocols/irc/irc.c	34a2f5f55635b8c8b0436670e0b78e6a6b178246
@@ -403,8 +403,7 @@ static gboolean do_login(PurpleConnectio
 
 static gboolean do_login(PurpleConnection *gc) {
 	char *buf, *tmp = NULL;
-	char *hostname, *server;
-	const char *hosttmp;
+	char *server;
 	const char *username, *realname;
 	struct irc_conn *irc = gc->proto_data;
 	const char *pass = purple_connection_get_password(gc);
@@ -432,17 +431,6 @@ static gboolean do_login(PurpleConnectio
 		}
 	}
 
-	hosttmp = purple_get_host_name();
-	if (*hosttmp == ':') {
-		/* This is either an IPv6 address, or something which
-		 * doesn't belong here.  Either way, we need to escape
-		 * it. */
-		hostname = g_strdup_printf("0%s", hosttmp);
-	} else {
-		/* Ugly, I know. */
-		hostname = g_strdup(hosttmp);
-	}
-
 	if (*irc->server == ':') {
 		/* Same as hostname, above. */
 		server = g_strdup_printf("0%s", irc->server);
@@ -450,10 +438,9 @@ static gboolean do_login(PurpleConnectio
 		server = g_strdup(irc->server);
 	}
 
-	buf = irc_format(irc, "vvvv:", "USER", tmp ? tmp : username, hostname, server,
+	buf = irc_format(irc, "vvvv:", "USER", tmp ? tmp : username, "*", server,
 	                 strlen(realname) ? realname : IRC_DEFAULT_ALIAS);
 	g_free(tmp);
-	g_free(hostname);
 	g_free(server);
 	if (irc_send(irc, buf) < 0) {
 		g_free(buf);


More information about the Commits mailing list