diff options
author | Mu Qiao <qiaomuf@gentoo.org> | 2011-01-24 07:31:49 +0000 |
---|---|---|
committer | Mu Qiao <qiaomuf@gentoo.org> | 2011-01-24 07:31:49 +0000 |
commit | e1ef435f87190a81e2580be5f4ac635de6d3f988 (patch) | |
tree | e96de5abe8228bb6d321e258faa56b6d9591b128 | |
parent | Marked ~hppa (bug #351526). (diff) | |
download | historical-e1ef435f87190a81e2580be5f4ac635de6d3f988.tar.gz historical-e1ef435f87190a81e2580be5f4ac635de6d3f988.tar.bz2 historical-e1ef435f87190a81e2580be5f4ac635de6d3f988.zip |
Revision bump wrt bug #350476
Package-Manager: portage-2.1.9.25/cvs/Linux x86_64
-rw-r--r-- | net-misc/networkmanager/ChangeLog | 10 | ||||
-rw-r--r-- | net-misc/networkmanager/Manifest | 18 | ||||
-rw-r--r-- | net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch | 454 | ||||
-rw-r--r-- | net-misc/networkmanager/networkmanager-0.8.2-r3.ebuild | 152 |
4 files changed, 617 insertions, 17 deletions
diff --git a/net-misc/networkmanager/ChangeLog b/net-misc/networkmanager/ChangeLog index f39e74b0d7f5..5b8aba707266 100644 --- a/net-misc/networkmanager/ChangeLog +++ b/net-misc/networkmanager/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-misc/networkmanager -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.92 2010/12/18 10:12:11 qiaomuf Exp $ +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.93 2011/01/24 07:31:48 qiaomuf Exp $ + +*networkmanager-0.8.2-r3 (24 Jan 2011) + + 24 Jan 2011; Mu Qiao <qiaomuf@gentoo.org> +networkmanager-0.8.2-r3.ebuild, + +files/networkmanager-0.8.2-shared-connection.patch: + fix shared connection wrt bug #350476 17 Dec 2010; Robert Piasek <dagger@gentoo.org> files/networkmanager-0.8.2-1.patch: diff --git a/net-misc/networkmanager/Manifest b/net-misc/networkmanager/Manifest index c0275d9e9809..3b097ff47ed1 100644 --- a/net-misc/networkmanager/Manifest +++ b/net-misc/networkmanager/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - AUX NetworkManagerDispatcher 1198 RMD160 4345870ab40607b9aed80c8da383b604f032b98e SHA1 1dd2250c746b25566fceaab551f4ef8335fe4f55 SHA256 f8cb5d0470619cf1f0812fffcf1bf2091e3c44a757899c07164f80ddd6a2641e AUX networkmanager-0.8-confchanges.patch 1063 RMD160 25a0d45410fa5590098386556e9947dd15507eda SHA1 ba6eaa63188f97f93bbbb327676d8104bbf7e8c8 SHA256 9fcbe0b9ab4cc38c9057a0dde2f5153efc12515ed4d28920a455dad7fc2b1e09 AUX networkmanager-0.8-nscd-clear-cache.patch 1214 RMD160 2381f455593202a740e634601c0ba8245ecb8fac SHA1 b4a0cec446b6f8fa81c06d5992db61b296f17057 SHA256 2d981bafa96607acb06740d78b8e33afdc675c52b0cf3ce5b098c67566362c99 @@ -14,6 +11,7 @@ AUX networkmanager-0.8.1-glib-2.25.12-workaround.patch 663 RMD160 b4397b17a61482 AUX networkmanager-0.8.2-1.patch 6642 RMD160 466f7c2bd34043d13d1b265f4a52b172c594430e SHA1 7af80cb4ea3cf1d60566c8dacd3eadc3ef4cc186 SHA256 f29cfa186c9b77452266e9c303711c2368986fb7e5455e388a5dfe064e80b3e3 AUX networkmanager-0.8.2-accept-gw.patch 3679 RMD160 b163afa5215f0eb52ba2562d22c65ec5e0bd3380 SHA1 a71f25413abf0c359439add74a73545790604ac9 SHA256 631ccad5bc4c2d880b5235bc8e6ace494467bad1734023ded9d8bcd52b9177af AUX networkmanager-0.8.2-confchanges.patch 1279 RMD160 1ff5b6d663aa4417beaf9c7630d710a17a1812b5 SHA1 634ad19b189509e75362e5cd7f069ca795b4aeba SHA256 7c9ed8dc35b5b6d0414f96902fbe8117408ad556af655c0afc593ec5a1beac28 +AUX networkmanager-0.8.2-shared-connection.patch 14961 RMD160 4c37ccb1e63c12dac0b60aabf2d107d51f1f2ac9 SHA1 709f4d9104d2423699d934ad9eca5e8cc3233395 SHA256 93ae68009518c4bdf809a43eb84c063042cf5d2bf099da8aeb8f52c97be42b9b AUX nm-system-settings.conf 23 RMD160 6d66c702b345bde668a420a15716feea6005fbd1 SHA1 49ba558d20f5ca5a201e027e13b878dd5ac3569c SHA256 44b048804c7c0b8b3b0c29b8632b6ad613c397d0a1635ec918e10c0fbcdadf21 AUX nm-system-settings.conf-ifnet 70 RMD160 c0d2be147383999b62cead86ab4333169e4ef277 SHA1 679ec8052b610969c148a2d34cd4da7a41484a76 SHA256 34f53d9ac1ad65eda6942dc3059117f60f6321059ca23f4fbfcc2f2edcae151f DIST NetworkManager-0.8.1.tar.bz2 1505134 RMD160 82f5ad1a641fa49acf34604f89154c865f3d5fbc SHA1 778989ed73cfd7ec05714f77121fa8bfc1bf0981 SHA256 dc126fbe3199d47899c4781e4fff32cee404dc7c728c6ade9eaa899bd80f19fa @@ -24,16 +22,6 @@ EBUILD networkmanager-0.8-r1.ebuild 3516 RMD160 8722fcf8330e8f11a1e3dd83f2e2b53c EBUILD networkmanager-0.8.1-r6.ebuild 4632 RMD160 15481e54c0f3e9502c8357fd6a6b772a53c7ceab SHA1 b656512bcd456c4b621cff0876e846954a6545df SHA256 ec4be6303fd338df4efc0e4c51bce67985b295a14a9b6eea0e0a46460fffe557 EBUILD networkmanager-0.8.2-r1.ebuild 4132 RMD160 1261ce2f0e499ece5e2ea4c010c8627ede1fa754 SHA1 96f9ac6b0ecaf0656386e82458453a97dfb8be61 SHA256 d247e094c0e22b885b78efa2cc8a6c8b32bbb5967f95a46439985d9a9da7362e EBUILD networkmanager-0.8.2-r2.ebuild 4248 RMD160 3dad60b3020562ffe57420ec35a00b244c7c7bbc SHA1 6e5a9805a9dc7f5fdc0ecaafc1c19135653afb19 SHA256 493187eaafb50c8c6294afd254beeaca570ad5f57b3b61a9f597356b86475bde -MISC ChangeLog 19052 RMD160 e5c1445bc494c916092cb75bc7ead061a76e8515 SHA1 8e4ab39bb93ace383f60ff2fe80212240348218d SHA256 7299337ad45b956ee759e35ac53705a867642f22f80c0df1f89607efe671a8cc +EBUILD networkmanager-0.8.2-r3.ebuild 4341 RMD160 aa1e9879343e0f881a80633ee8c36d8968985ca6 SHA1 8770a26819360dc1abfcadec49c1a3cd20e27475 SHA256 4be7d4b109c9a0245496d4bf7084a3429dd0a3a4a1fa9366c72c2e23dd46c28e +MISC ChangeLog 19265 RMD160 53fa5e33d101bd67f7be4391f9aa804e48f3235b SHA1 a6e5574dfbd8ea5a340e0ed5a81fd0b9b6f5540e SHA256 9195ea94ecbf547de25f4753a0785f2799e24223f6c9face533fbe7f52c116e0 MISC metadata.xml 975 RMD160 7f7f8f54c53fe2098dae8ed0a4cd177900289d3f SHA1 11de32f78915bbc01c6b0665b45233d004d75c25 SHA256 e0ce95394f82f5631ecec62c6595dc4dad9afc52cf5e1bb0f30618edfb79becc ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.16 (GNU/Linux) - -iQEcBAEBAgAGBQJNDIkIAAoJEDCzDeQXsVfpNMYH+wbM+xA46o8RDX10VGyRurHT -7DuESYnViN9Pt+gEsig/RtpuG4vsqTLjrTT+abAx+gfi19VrVvBhDdjzZMdyT+BX -UfcC1cZ6txSGsOOKcrESXW/FDYhOLSHiagzysLd/0BRa46t0du5Jiswc+bIphIqL -icUah4VqsgJe+DckAWOaSKkJvbOl2hTBpMFIIjtbbvOM5w2UoZb8eHcdP1rL23Av -sHjaGQnh0Qjd8Q0tlBcmyOoL5feDa3DzUKx+07eJuZ1P12E+dDbIwmLaTMrmRm+x -V7naK7BUXFXeYTg8kyk3xQeiicblUeRx/K/CdxbuF2CDNywPoYS8Wb9HVTaD9XM= -=fYsv ------END PGP SIGNATURE----- diff --git a/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch b/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch new file mode 100644 index 000000000000..8ffdf17915b8 --- /dev/null +++ b/net-misc/networkmanager/files/networkmanager-0.8.2-shared-connection.patch @@ -0,0 +1,454 @@ +From 5a67c7a5ad341fa84091287eb6452458c7ee24b0 Mon Sep 17 00:00:00 2001 +From: Mu Qiao <qiaomuf@gentoo.org> +Date: Wed, 5 Jan 2011 13:30:08 +0800 +Subject: [PATCH] Support shared and link-local method for ipv4 + Signed-off-by: Mu Qiao <qiaomuf@gentoo.org> + fix flush_to_file, return TRUE when nothing changed + ssid do not lose quotes anymore + do not delete old connection when ssid is not changed + +Signed-off-by: Mu Qiao <qiaomuf@gentoo.org> +--- + system-settings/plugins/ifnet/connection_parser.c | 92 ++++++++++++++------ + system-settings/plugins/ifnet/net_parser.c | 55 +++++++----- + system-settings/plugins/ifnet/net_parser.h | 4 +- + system-settings/plugins/ifnet/net_utils.c | 4 + + .../plugins/ifnet/nm-ifnet-connection.c | 8 +- + system-settings/plugins/ifnet/wpa_parser.c | 21 +++-- + 6 files changed, 123 insertions(+), 61 deletions(-) + +diff --git a/system-settings/plugins/ifnet/connection_parser.c b/system-settings/plugins/ifnet/connection_parser.c +index f9fae51..539f33c 100644 +--- a/system-settings/plugins/ifnet/connection_parser.c ++++ b/system-settings/plugins/ifnet/connection_parser.c +@@ -557,7 +557,7 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error) + + NMSettingIP4Config *ip4_setting = + NM_SETTING_IP4_CONFIG (nm_setting_ip4_config_new ()); +- gchar *value; ++ gchar *value, *method = NULL; + gboolean is_static_block = is_static_ip4 (conn_name); + ip_block *iblock = NULL; + +@@ -569,12 +569,42 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error) + && strstr (value, "nogateway") ? TRUE : FALSE, NULL); + + if (!is_static_block) { +- g_object_set (ip4_setting, +- NM_SETTING_IP4_CONFIG_METHOD, +- NM_SETTING_IP4_CONFIG_METHOD_AUTO, +- NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL); +- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Using DHCP for %s", +- conn_name); ++ method = ifnet_get_data (conn_name, "config"); ++ if (!method){ ++ g_set_error (error, ifnet_plugin_error_quark (), 0, ++ "Unknown config for %s", conn_name); ++ g_object_unref (ip4_setting); ++ return; ++ } ++ if (!strcmp (method, "dhcp")) ++ g_object_set (ip4_setting, ++ NM_SETTING_IP4_CONFIG_METHOD, ++ NM_SETTING_IP4_CONFIG_METHOD_AUTO, ++ NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL); ++ else if (!strcmp (method, "autoip")){ ++ g_object_set (ip4_setting, ++ NM_SETTING_IP4_CONFIG_METHOD, ++ NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL, ++ NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL); ++ nm_connection_add_setting (connection, NM_SETTING (ip4_setting)); ++ return; ++ } ++ else if (!strcmp (method, "shared")){ ++ g_object_set (ip4_setting, ++ NM_SETTING_IP4_CONFIG_METHOD, ++ NM_SETTING_IP4_CONFIG_METHOD_SHARED, ++ NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, FALSE, NULL); ++ nm_connection_add_setting (connection, NM_SETTING (ip4_setting)); ++ return; ++ } ++ else { ++ g_set_error (error, ifnet_plugin_error_quark (), 0, ++ "Unknown config for %s", conn_name); ++ g_object_unref (ip4_setting); ++ return; ++ } ++ PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Using %s method for %s", ++ method, conn_name); + } else { + iblock = convert_ip4_config_block (conn_name); + if (!iblock) { +@@ -625,7 +655,7 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error) + } + + /* add dhcp hostname and client id */ +- if (!is_static_block) { ++ if (method && !strcmp (method, "dhcp")) { + gchar *dhcp_hostname, *client_id; + + get_dhcp_hostname_and_client_id (&dhcp_hostname, &client_id); +@@ -712,7 +742,6 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error) + iblock = iblock->next; + destroy_ip_block (current_iblock); + } +- + /* Finally add setting to connection */ + nm_connection_add_setting (connection, NM_SETTING (ip4_setting)); + } +@@ -1243,10 +1272,10 @@ parse_wpa_psk (gchar * psk, GError ** error) + * the passphrase contains spaces. + */ + +- p = psk; +- if (p[0] == '"' && psk[strlen (psk) - 1] == '"') ++ p = g_strdup (psk); ++ if (p[0] == '"' && p[strlen (p) - 1] == '"') + quoted = TRUE; +- if (!quoted && (strlen (psk) == 64)) { ++ if (!quoted && (strlen (p) == 64)) { + /* Verify the hex PSK; 64 digits */ + if (!is_hex (p)) { + g_set_error (error, ifnet_plugin_error_quark (), +@@ -1254,7 +1283,7 @@ parse_wpa_psk (gchar * psk, GError ** error) + "Invalid WPA_PSK (contains non-hexadecimal characters)"); + goto out; + } +- hashed = g_strdup (psk); ++ hashed = g_strdup (p); + } else { + strip_string (p, '"'); + +@@ -1276,6 +1305,7 @@ parse_wpa_psk (gchar * psk, GError ** error) + } + + out: ++ g_free (p); + return hashed; + } + +@@ -2085,7 +2115,8 @@ write_wireless_security_setting (NMConnection * connection, + } else if (!strcmp (key_mgmt, "wpa-eap")) { + wpa_set_data (conn_name, "key_mgmt", "WPA-EAP"); + wpa = TRUE; +- } ++ } else ++ PLUGIN_WARN (IFNET_PLUGIN_NAME, "Unknown key_mgmt: %s", key_mgmt); + + if (auth_alg) { + if (!strcmp (auth_alg, "shared")) +@@ -2180,8 +2211,11 @@ write_wireless_security_setting (NMConnection * connection, + g_string_append (quoted, psk); + g_string_append_c (quoted, '"'); + } +- wpa_set_data (conn_name, "psk", +- quoted ? quoted->str : (gchar *) psk); ++ if (psk) ++ wpa_set_data (conn_name, "psk", ++ quoted ? quoted->str : (gchar *) psk); ++ else ++ PLUGIN_WARN (IFNET_PLUGIN_NAME, "Use WPA, but no psk received from NM"); + if (quoted) + g_string_free (quoted, TRUE); + } else +@@ -2190,15 +2224,19 @@ write_wireless_security_setting (NMConnection * connection, + return TRUE; + } + +-/* remove old ssid and add new one*/ ++/* Only remove old config when ssid is changed. ++ * See bug #350476. ++ * */ + static void + update_wireless_ssid (NMConnection * connection, gchar * conn_name, + gchar * ssid, gboolean hex) + { +- ifnet_delete_network (conn_name); +- ifnet_add_connection (ssid, "wireless"); ++ if (strcmp (conn_name, ssid)){ ++ ifnet_delete_network (conn_name); ++ wpa_delete_security (conn_name); ++ } + +- wpa_delete_security (conn_name); ++ ifnet_add_network (ssid, "wireless"); + wpa_add_security (ssid); + } + +@@ -2443,8 +2481,12 @@ write_ip4_setting (NMConnection * connection, gchar * conn_name, + } + ifnet_set_data (conn_name, "config", ips->str); + g_string_free (ips, TRUE); +- } else +- ifnet_set_data (conn_name, "config", "dhcp"); ++ } else if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) ++ ifnet_set_data (conn_name, "config", "shared"); ++ else if (!strcmp (value, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) ++ ifnet_set_data (conn_name, "config", "autoip"); ++ else ++ ifnet_set_data (conn_name, "config", "dhcp"); + + /* DNS Servers */ + ifnet_set_data (conn_name, "dns_servers", NULL); +@@ -2858,7 +2900,7 @@ get_wired_name () + for (; i < 256; i++) { + gchar *conn_name = g_strdup_printf ("eth%d", i); + +- if (!ifnet_has_connection (conn_name)) { ++ if (!ifnet_has_network (conn_name)) { + return conn_name; + } else + g_free (conn_name); +@@ -2875,7 +2917,7 @@ get_ppp_name () + for (; i < 256; i++) { + gchar *conn_name = g_strdup_printf ("ppp%d", i); + +- if (!ifnet_has_connection (conn_name)) { ++ if (!ifnet_has_network (conn_name)) { + return conn_name; + } else + g_free (conn_name); +@@ -2982,7 +3024,7 @@ ifnet_add_new_connection (NMConnection * connection, + goto out; + } + +- if (ifnet_add_connection (new_name, new_type)) ++ if (ifnet_add_network (new_name, new_type)) + success = + ifnet_update_parsers_by_connection (connection, new_name, + NULL, config_file, +diff --git a/system-settings/plugins/ifnet/net_parser.c b/system-settings/plugins/ifnet/net_parser.c +index b4a381d..de2db8a 100644 +--- a/system-settings/plugins/ifnet/net_parser.c ++++ b/system-settings/plugins/ifnet/net_parser.c +@@ -37,6 +37,9 @@ static GList *functions_list; + /* Used to decide whether to write changes to file*/ + static gboolean net_parser_data_changed = FALSE; + ++static void ++destroy_connection_config (GHashTable * conn); ++ + static GHashTable * + add_new_connection_config (const gchar * type, const gchar * name) + { +@@ -58,8 +61,10 @@ add_new_connection_config (const gchar * type, const gchar * name) + } + + gboolean +-ifnet_add_connection (gchar * name, gchar * type) ++ifnet_add_network (gchar * name, gchar * type) + { ++ if (ifnet_has_network (name)) ++ return TRUE; + if (add_new_connection_config (type, name)) { + PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Adding network for %s", name); + net_parser_data_changed = TRUE; +@@ -69,11 +74,27 @@ ifnet_add_connection (gchar * name, gchar * type) + } + + gboolean +-ifnet_has_connection (gchar * conn_name) ++ifnet_has_network (gchar * conn_name) + { + return g_hash_table_lookup (conn_table, conn_name) != NULL; + } + ++gboolean ++ifnet_delete_network (gchar * conn_name) ++{ ++ GHashTable *network = NULL; ++ ++ g_return_val_if_fail (conn_table != NULL && conn_name != NULL, FALSE); ++ PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting network for %s", conn_name); ++ network = g_hash_table_lookup (conn_table, conn_name); ++ if (!network) ++ return FALSE; ++ g_hash_table_remove (conn_table, conn_name); ++ destroy_connection_config (network); ++ net_parser_data_changed = TRUE; ++ return TRUE; ++} ++ + static GHashTable * + get_connection_config (gchar * name) + { +@@ -377,21 +398,27 @@ ifnet_set_data (gchar * conn_name, gchar * key, gchar * value) + { + gpointer orin_key = NULL, orin_value = NULL; + GHashTable *conn = g_hash_table_lookup (conn_table, conn_name); ++ gchar *new_value = NULL; + + if (!conn) { + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "%s does not exsit!", conn_name); + return; + } ++ if (value){ ++ new_value = g_strdup (value); ++ strip_string (new_value, '"'); ++ } + /* Remove existing key value pair */ + if (g_hash_table_lookup_extended (conn, key, &orin_key, &orin_value)) { ++ if (new_value && !strcmp (orin_value, new_value)) ++ return; + g_hash_table_remove (conn, orin_key); + g_free (orin_key); + g_free (orin_value); + } +- if (value) +- g_hash_table_insert (conn, g_strdup (key), +- strip_string (g_strdup (value), '"')); ++ if (new_value) ++ g_hash_table_insert (conn, g_strdup (key), new_value); + net_parser_data_changed = TRUE; + } + +@@ -467,7 +494,7 @@ ifnet_flush_to_file (gchar * config_file) + gboolean result = FALSE; + + if (!net_parser_data_changed) +- return FALSE; ++ return TRUE; + if (!conn_table || !global_settings_table) + return FALSE; + +@@ -583,22 +610,6 @@ ifnet_flush_to_file (gchar * config_file) + return result; + } + +-gboolean +-ifnet_delete_network (gchar * conn_name) +-{ +- GHashTable *network = NULL; +- +- g_return_val_if_fail (conn_table != NULL && conn_name != NULL, FALSE); +- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Deleting network for %s", conn_name); +- network = g_hash_table_lookup (conn_table, conn_name); +- if (!network) +- return FALSE; +- g_hash_table_remove (conn_table, conn_name); +- destroy_connection_config (network); +- net_parser_data_changed = TRUE; +- return TRUE; +-} +- + void + ifnet_destroy (void) + { +diff --git a/system-settings/plugins/ifnet/net_parser.h b/system-settings/plugins/ifnet/net_parser.h +index 73a44c8..b71a01f 100644 +--- a/system-settings/plugins/ifnet/net_parser.h ++++ b/system-settings/plugins/ifnet/net_parser.h +@@ -36,11 +36,11 @@ GList *ifnet_get_connection_names (void); + gchar *ifnet_get_data (gchar * conn_name, const gchar * key); + gchar *ifnet_get_global_data (const gchar * key); + gchar *ifnet_get_global_setting (gchar * group, gchar * key); +-gboolean ifnet_has_connection (gchar * conn_name); ++gboolean ifnet_has_network (gchar * conn_name); + + /* Writer functions */ + gboolean ifnet_flush_to_file (gchar * config_file); + void ifnet_set_data (gchar * conn_name, gchar * key, gchar * value); +-gboolean ifnet_add_connection (gchar * name, gchar * type); ++gboolean ifnet_add_network (gchar * name, gchar * type); + gboolean ifnet_delete_network (gchar * conn_name); + #endif +diff --git a/system-settings/plugins/ifnet/net_utils.c b/system-settings/plugins/ifnet/net_utils.c +index 2dc253c..7e52f10 100644 +--- a/system-settings/plugins/ifnet/net_utils.c ++++ b/system-settings/plugins/ifnet/net_utils.c +@@ -278,6 +278,10 @@ is_static_ip4 (gchar * conn_name) + + if (!data) + return FALSE; ++ if (!strcmp (data, "shared")) ++ return FALSE; ++ if (!strcmp (data, "autoip")) ++ return FALSE; + dhcp6 = strstr (data, "dhcp6"); + if (dhcp6) { + gchar *dhcp4; +diff --git a/system-settings/plugins/ifnet/nm-ifnet-connection.c b/system-settings/plugins/ifnet/nm-ifnet-connection.c +index e47495c..ebe2581 100644 +--- a/system-settings/plugins/ifnet/nm-ifnet-connection.c ++++ b/system-settings/plugins/ifnet/nm-ifnet-connection.c +@@ -71,12 +71,14 @@ nm_ifnet_connection_new (gchar * conn_name) + { + NMConnection *tmp; + GObject *object; +- GError **error = NULL; ++ GError *error = NULL; + + g_return_val_if_fail (conn_name != NULL, NULL); +- tmp = ifnet_update_connection_from_config_block (conn_name, error); +- if (!tmp) ++ tmp = ifnet_update_connection_from_config_block (conn_name, &error); ++ if (!tmp){ ++ g_error_free (error); + return NULL; ++ } + object = (GObject *) g_object_new (NM_TYPE_IFNET_CONNECTION, + NM_IFNET_CONNECTION_CONN_NAME, + conn_name, NULL); +diff --git a/system-settings/plugins/ifnet/wpa_parser.c b/system-settings/plugins/ifnet/wpa_parser.c +index 5e94108..42c52c3 100644 +--- a/system-settings/plugins/ifnet/wpa_parser.c ++++ b/system-settings/plugins/ifnet/wpa_parser.c +@@ -366,7 +366,7 @@ wpa_flush_to_file (gchar * config_file) + gboolean result = FALSE; + + if (!wpa_parser_data_changed) +- return FALSE; ++ return TRUE; + if (!wsec_table || !wsec_global_table) + return FALSE; + +@@ -450,26 +450,29 @@ wpa_set_data (gchar * ssid, gchar * key, gchar * value) + { + gpointer orig_key = NULL, orig_value = NULL; + GHashTable *security = g_hash_table_lookup (wsec_table, ssid); ++ gchar *new_value = NULL; + + g_return_if_fail (security != NULL); + ++ if (value){ ++ new_value = g_strdup(value); ++ if (strcmp (key, "ssid") != 0 && strcmp (key, "psk") != 0 ++ && !g_str_has_prefix (key, "wep_key")) ++ strip_string (new_value, '"'); ++ } + /* Remove old key value pairs */ + if (g_hash_table_lookup_extended + (security, key, &orig_key, &orig_value)) { ++ if (new_value && !strcmp(orig_value, new_value)) ++ return; + g_hash_table_remove (security, orig_key); + g_free (orig_key); + g_free (orig_value); + } + + /* Add new key value */ +- if (value) { +- gchar *new_value = g_strdup (value); +- +- if (strcmp (key, "ssid") != 0 && strcmp (key, "psk") != 0 +- && !g_str_has_prefix (key, "wep_key")) +- strip_string (new_value, '"'); ++ if (new_value) + g_hash_table_insert (security, g_strdup (key), new_value); +- } + wpa_parser_data_changed = TRUE; + } + +@@ -483,7 +486,7 @@ gboolean + wpa_add_security (gchar * ssid) + { + if (wpa_has_security (ssid)) +- return FALSE; ++ return TRUE; + else { + GHashTable *security = + g_hash_table_new (g_str_hash, g_str_equal); +-- +1.7.3.4 + diff --git a/net-misc/networkmanager/networkmanager-0.8.2-r3.ebuild b/net-misc/networkmanager/networkmanager-0.8.2-r3.ebuild new file mode 100644 index 000000000000..a36ccfb1af60 --- /dev/null +++ b/net-misc/networkmanager/networkmanager-0.8.2-r3.ebuild @@ -0,0 +1,152 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.8.2-r3.ebuild,v 1.1 2011/01/24 07:31:48 qiaomuf Exp $ + +EAPI="2" + +inherit gnome.org linux-info + +# NetworkManager likes itself with capital letters +MY_PN=${PN/networkmanager/NetworkManager} +MY_P=${MY_PN}-${PV} + +DESCRIPTION="Network configuration and management in an easy way. Desktop environment independent." +HOMEPAGE="http://www.gnome.org/projects/NetworkManager/" +SRC_URI="${SRC_URI//${PN}/${MY_PN}}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" +IUSE="avahi bluetooth doc nss gnutls dhclient dhcpcd kernel_linux resolvconf connection-sharing" + +RDEPEND=">=sys-apps/dbus-1.2 + >=dev-libs/dbus-glib-0.75 + >=net-wireless/wireless-tools-28_pre9 + >=sys-fs/udev-145[extras] + >=dev-libs/glib-2.18 + >=sys-auth/polkit-0.92 + >=dev-libs/libnl-1.1 + >=net-misc/modemmanager-0.4 + >=net-wireless/wpa_supplicant-0.5.10[dbus] + bluetooth? ( net-wireless/bluez ) + || ( sys-libs/e2fsprogs-libs <sys-fs/e2fsprogs-1.41.0 ) + avahi? ( net-dns/avahi[autoipd] ) + gnutls? ( + nss? ( >=dev-libs/nss-3.11 ) + !nss? ( dev-libs/libgcrypt + net-libs/gnutls ) ) + !gnutls? ( >=dev-libs/nss-3.11 ) + dhclient? ( + dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 ) + !dhcpcd? ( net-misc/dhcp ) ) + !dhclient? ( >=net-misc/dhcpcd-4.0.0_rc3 ) + resolvconf? ( net-dns/openresolv ) + connection-sharing? ( + net-dns/dnsmasq + net-firewall/iptables )" + +DEPEND="${RDEPEND} + dev-util/pkgconfig + dev-util/intltool + >=net-dialup/ppp-2.4.5 + doc? ( >=dev-util/gtk-doc-1.8 )" + +S=${WORKDIR}/${MY_P} + +sysfs_deprecated_check() { + ebegin "Checking for SYSFS_DEPRECATED support" + + if { linux_chkconfig_present SYSFS_DEPRECATED_V2; }; then + eerror "Please disable SYSFS_DEPRECATED_V2 support in your kernel config and recompile your kernel" + eerror "or NetworkManager will not work correctly." + eerror "See http://bugs.gentoo.org/333639 for more info." + die "CONFIG_SYSFS_DEPRECATED_V2 support detected!" + fi + eend $? +} + +pkg_setup() { + + if use kernel_linux; then + get_version + if linux_config_exists; then + sysfs_deprecated_check + else + ewarn "Was unable to determine your kernel .config" + ewarn "Please note that if CONFIG_SYSFS_DEPRECATED_V2 is set in your kernel .config, NetworkManager will not work correctly." + ewarn "See http://bugs.gentoo.org/333639 for more info." + fi + + fi +} + +src_prepare() { + # dbus policy patch + epatch "${FILESDIR}/${P}-confchanges.patch" + # accept "gw" in /etc/conf.d/net (bug #339215) + epatch "${FILESDIR}/${P}-accept-gw.patch" + # fix shared connection wrt bug #350476 + epatch "${FILESDIR}/${P}-shared-connection.patch" + # Backports #1 + epatch "${FILESDIR}/${P}-1.patch" +} + +src_configure() { + ECONF="--disable-more-warnings + --localstatedir=/var + --with-distro=gentoo + --with-dbus-sys-dir=/etc/dbus-1/system.d + --with-udev-dir=/etc/udev + --with-iptables=/sbin/iptables + $(use_enable doc gtk-doc) + $(use_with doc docs) + $(use_with resolvconf)" + + # default is dhcpcd (if none or both are specified), ISC dchclient otherwise + if use dhclient ; then + if use dhcpcd ; then + ECONF="${ECONF} --with-dhcpcd --without-dhclient" + else + ECONF="${ECONF} --with-dhclient --without-dhcpcd" + fi + else + ECONF="${ECONF} --with-dhcpcd --without-dhclient" + fi + + # default is NSS (if none or both are specified), GnuTLS otherwise + if use gnutls ; then + if use nss ; then + ECONF="${ECONF} --with-crypto=nss" + else + ECONF="${ECONF} --with-crypto=gnutls" + fi + else + ECONF="${ECONF} --with-crypto=nss" + fi + + econf ${ECONF} +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed" + + # Need to keep the /var/run/NetworkManager directory + keepdir /var/run/NetworkManager + + # Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts + keepdir /etc/NetworkManager/dispatcher.d + + dodoc AUTHORS ChangeLog NEWS README TODO || die "dodoc failed" + + # Add keyfile plugin support + keepdir /etc/NetworkManager/system-connections + insinto /etc/NetworkManager + newins "${FILESDIR}/nm-system-settings.conf-ifnet" nm-system-settings.conf \ + || die "newins failed" +} + +pkg_postinst() { + elog "You will need to reload DBus if this is your first time installing" + elog "NetworkManager, or if you're upgrading from 0.7 or older." + elog "" +} |