[network-manager-applet] applet: blacklist "Free Public Wifi"



commit c0a5e1075b51bf60a3944b0e89ce75bb1365bd33
Author: Chris Aillon <caillon redhat com>
Date:   Wed Feb 23 12:46:33 2011 -0600

    applet: blacklist "Free Public Wifi"

 src/applet-device-wifi.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c
index 3b333e3..5db9560 100644
--- a/src/applet-device-wifi.c
+++ b/src/applet-device-wifi.c
@@ -194,6 +194,19 @@ is_manufacturer_default_ssid (const GByteArray *ssid)
 	return is_ssid_in_list (ssid, manf_default_ssids);
 }
 
+/* List known trojan networks that should never be shown to the user */
+static const char *blacklisted_ssids[] = {
+	/* http://www.npr.org/templates/story/story.php?storyId=130451369 */
+	"Free Public WiFi",
+	NULL
+};
+
+static gboolean
+is_blacklisted_ssid (const GByteArray *ssid)
+{
+	return is_ssid_in_list (ssid, blacklisted_ssids);
+}
+
 static void
 add_ciphers_from_flags (NMSettingWirelessSecurity *sec,
                         guint32 flags,
@@ -600,9 +613,11 @@ get_menu_item_for_ap (NMDeviceWifi *device,
 	const GByteArray *ssid;
 	struct dup_data dup_data = { NULL, NULL };
 
-	/* Don't add BSSs that hide their SSID */
+	/* Don't add BSSs that hide their SSID or are blacklisted */
 	ssid = nm_access_point_get_ssid (ap);
-	if (!ssid || nm_utils_is_empty_ssid (ssid->data, ssid->len))
+	if (   !ssid
+	    || nm_utils_is_empty_ssid (ssid->data, ssid->len)
+	    || is_blacklisted_ssid (ssid))
 		return NULL;
 
 	/* Find out if this AP is a member of a larger network that all uses the



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]