diff libpurple/protocols/irc/irc.c @ 31897:1a248102e437

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
author Ethan Blanton <elb@pidgin.im>
date Sun, 03 Apr 2011 20:21:22 +0000
parents 7c33eaed54e5
children 6b3bc0947068 54a700cedb38
line wrap: on
line diff
--- a/libpurple/protocols/irc/irc.c	Sat Apr 02 18:03:54 2011 +0000
+++ b/libpurple/protocols/irc/irc.c	Sun Apr 03 20:21:22 2011 +0000
@@ -403,8 +403,7 @@
 
 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 @@
 		}
 	}
 
-	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 @@
 		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);