[PATCH 1/3] fix crash for wireless-ssid setting (debbugs: #513852)



* system-settings/plugins/ifupdown/parser.c
 	- (update_wireless_setting_from_if_block): fix ifupdown
 		crash for wireless-ssid setting (debbugs: #513852)


Signed-off-by: Alexander Sack <asac ubuntu com>
---
 ChangeLog                                 |    6 ++++++
 system-settings/plugins/ifupdown/parser.c |   13 ++++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d529664..0e03d80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-03  Alexander Sack  <asac ubuntu com>
+
+	* system-settings/plugins/ifupdown/parser.c
+		- (update_wireless_setting_from_if_block): fix ifupdown
+			crash for wireless-ssid setting (debbugs: #513852)
+
 2008-12-11  Dan Williams  <dcbw redhat com>
 
 	* Move NetworkManager to git.freedesktop.org
diff --git a/system-settings/plugins/ifupdown/parser.c b/system-settings/plugins/ifupdown/parser.c
index 400e2a1..25e866a 100644
--- a/system-settings/plugins/ifupdown/parser.c
+++ b/system-settings/plugins/ifupdown/parser.c
@@ -153,9 +153,20 @@ update_wireless_setting_from_if_block(NMConnection *connection,
 			const gchar* newkey = map_by_mapping(mapping, curr->key+wireless_l);
 			PLUGIN_PRINT ("SCPlugin-Ifupdown", "wireless setting key: %s='%s'",
 					    newkey, curr->data);
-			g_object_set(wireless_setting,
+			if(newkey && !strcmp("ssid", newkey)) {
+				GByteArray *ssid;
+				gint len = strlen(curr->data);
+
+				ssid = g_byte_array_sized_new (len);
+				g_byte_array_append (ssid, (const guint8 *) curr->data, len);
+				g_object_set (wireless_setting, NM_SETTING_WIRELESS_SSID, ssid, NULL);
+				g_byte_array_free (ssid, TRUE);
+				PLUGIN_PRINT("SCPlugin-Ifupdown", "setting wireless ssid = %d", len);
+			} else {
+				g_object_set(wireless_setting,
 					   newkey, curr->data,
 					   NULL);
+			}
 		} else if(strlen(curr->key) > wpa_l &&
 				!strncmp("wpa-", curr->key, wpa_l)) {
 			const gchar* newkey = map_by_mapping(mapping, curr->key+wpa_l);
-- 
1.6.0.4



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