diff options
author | 2011-02-26 05:59:00 +0000 | |
---|---|---|
committer | 2011-02-26 05:59:00 +0000 | |
commit | e891baa3e96045c4941923fcf4e95bea0bb70c82 (patch) | |
tree | 1c5cfb8b5e4b64aeb41c97fe9279d664e3e24b57 | |
parent | EAPI 3, dependencies, docs, etc. (diff) | |
download | gentoo-2-e891baa3e96045c4941923fcf4e95bea0bb70c82.tar.gz gentoo-2-e891baa3e96045c4941923fcf4e95bea0bb70c82.tar.bz2 gentoo-2-e891baa3e96045c4941923fcf4e95bea0bb70c82.zip |
Accept non-alnum ssid (bug #356337)
(Portage version: 2.1.9.41/cvs/Linux x86_64)
3 files changed, 278 insertions, 20 deletions
diff --git a/net-misc/networkmanager/ChangeLog b/net-misc/networkmanager/ChangeLog index f8e4149d998c..ec9687cb43b2 100644 --- a/net-misc/networkmanager/ChangeLog +++ b/net-misc/networkmanager/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-misc/networkmanager # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.98 2011/02/25 09:54:42 qiaomuf Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.99 2011/02/26 05:59:00 qiaomuf Exp $ + +*networkmanager-0.8.2-r8 (26 Feb 2011) + + 26 Feb 2011; Mu Qiao <qiaomuf@gentoo.org> +networkmanager-0.8.2-r8.ebuild, + files/networkmanager-0.8.2-ifnet-smarter-write.patch: + Accept non-alnum ssid (bug #356337) *networkmanager-0.8.2-r7 (25 Feb 2011) diff --git a/net-misc/networkmanager/files/networkmanager-0.8.2-ifnet-smarter-write.patch b/net-misc/networkmanager/files/networkmanager-0.8.2-ifnet-smarter-write.patch index 0ca2e618858d..a1f589d0062b 100644 --- a/net-misc/networkmanager/files/networkmanager-0.8.2-ifnet-smarter-write.patch +++ b/net-misc/networkmanager/files/networkmanager-0.8.2-ifnet-smarter-write.patch @@ -1,44 +1,131 @@ -From ad30f01d6108a7e8e05e5e90c93b2a750b7be240 Mon Sep 17 00:00:00 2001 +From 5b018326db5c9ebad8a63e1e231f49d2ca65e28c Mon Sep 17 00:00:00 2001 From: Mu Qiao <qiaomuf@gentoo.org> Date: Fri, 25 Feb 2011 16:25:07 +0000 Subject: [PATCH 3/3] Won't write when nothing changed Signed-off-by: Mu Qiao <qiaomuf@gentoo.org> + Make log less excessive, accept non-alnum ssid (bug #356337) +Signed-off-by: Mu Qiao <qiaomuf@gentoo.org> --- - system-settings/plugins/ifnet/net_parser.c | 14 ++++++++++---- - system-settings/plugins/ifnet/wpa_parser.c | 3 ++- - 2 files changed, 12 insertions(+), 5 deletions(-) + system-settings/plugins/ifnet/connection_parser.c | 24 ++++++-------------- + system-settings/plugins/ifnet/net_parser.c | 8 +++++- + system-settings/plugins/ifnet/plugin.c | 4 --- + system-settings/plugins/ifnet/wpa_parser.c | 7 ++++- + 4 files changed, 18 insertions(+), 25 deletions(-) +diff --git a/system-settings/plugins/ifnet/connection_parser.c b/system-settings/plugins/ifnet/connection_parser.c +index 9b5ddc1..8600142 100644 +--- a/system-settings/plugins/ifnet/connection_parser.c ++++ b/system-settings/plugins/ifnet/connection_parser.c +@@ -627,23 +627,13 @@ make_ip4_setting (NMConnection * connection, gchar * conn_name, GError ** error) + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, + TRUE, NULL); +- if (nm_setting_ip4_config_add_address +- (ip4_setting, ip4_addr)) { +- PLUGIN_PRINT (IFNET_PLUGIN_NAME, +- "new address: %d", iblock->ip); +- PLUGIN_PRINT (IFNET_PLUGIN_NAME, +- "ipv4 addresses count: %d", +- nm_setting_ip4_config_get_num_addresses +- (ip4_setting)); +- } else { +- PLUGIN_WARN (IFNET_PLUGIN_NAME, +- "ignoring duplicate IP4 address"); +- } ++ if (!nm_setting_ip4_config_add_address (ip4_setting, ip4_addr)) ++ PLUGIN_WARN (IFNET_PLUGIN_NAME, ++ "ignoring duplicate IP4 address"); + nm_ip4_address_unref (ip4_addr); + current_iblock = iblock; + iblock = iblock->next; + destroy_ip_block (current_iblock); +- + } + g_object_set (ip4_setting, + NM_SETTING_IP4_CONFIG_METHOD, +@@ -2276,11 +2266,12 @@ write_wireless_setting (NMConnection * connection, + return FALSE; + } + +- /* If the SSID contains any non-printable characters, we need to use the +- * hex notation of the SSID instead. ++ /* If the SSID contains any non-alnum characters, we need to use ++ * the hex notation of the SSID instead. (Because openrc doesn't ++ * support these characters, see bug #356337) + */ + for (i = 0; i < ssid->len; i++) { +- if (!isprint (ssid->data[i])) { ++ if (!isalnum (ssid->data[i])) { + hex_ssid = TRUE; + break; + } +@@ -2487,7 +2478,6 @@ write_ip4_setting (NMConnection * connection, gchar * conn_name, + ifnet_set_data (conn_name, "config", "dhcp"); + + /* DNS Servers */ +- ifnet_set_data (conn_name, "dns_servers", NULL); + num = nm_setting_ip4_config_get_num_dns (s_ip4); + if (num > 0) { + dns = g_string_new (NULL); diff --git a/system-settings/plugins/ifnet/net_parser.c b/system-settings/plugins/ifnet/net_parser.c -index de2db8a..e01b092 100644 +index de2db8a..57f3688 100644 --- a/system-settings/plugins/ifnet/net_parser.c +++ b/system-settings/plugins/ifnet/net_parser.c -@@ -413,10 +413,16 @@ ifnet_set_data (gchar * conn_name, gchar * key, gchar * value) +@@ -411,12 +411,16 @@ ifnet_set_data (gchar * conn_name, gchar * key, gchar * 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)) +- if (new_value && !strcmp (orin_value, new_value)) ++ if (new_value && !strcmp (orin_value, new_value)){ ++ g_free (new_value); return; -- g_hash_table_remove (conn, orin_key); -- g_free (orin_key); -- g_free (orin_value); ++ } + g_hash_table_remove (conn, orin_key); + g_free (orin_key); + g_free (orin_value); - } -+ /* Won't remove dns_servers wrt bug #356339 */ -+ if (strcmp (orin_key, "dns_servers")){ -+ g_hash_table_remove (conn, orin_key); -+ g_free (orin_key); -+ g_free (orin_value); -+ } else -+ return; + /* old key/value doesn't exist but new value is NULL */ + } else if (!value) + return; if (new_value) g_hash_table_insert (conn, g_strdup (key), new_value); net_parser_data_changed = TRUE; +diff --git a/system-settings/plugins/ifnet/plugin.c b/system-settings/plugins/ifnet/plugin.c +index 94f9e79..3952e91 100644 +--- a/system-settings/plugins/ifnet/plugin.c ++++ b/system-settings/plugins/ifnet/plugin.c +@@ -91,8 +91,6 @@ update_system_hostname (gpointer config) + { + SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (config); + +- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Updating hostname"); +- + if (priv->hostname) + g_free (priv->hostname); + priv->hostname = read_hostname (IFNET_SYSTEM_HOSTNAME_FILE); +@@ -184,8 +182,6 @@ monitor_file_changes (const char *filename, + info); + g_signal_connect (monitor, "changed", G_CALLBACK (file_changed), + info); +- PLUGIN_PRINT (IFNET_PLUGIN_NAME, "Monitoring %s", filename); +- + } else + PLUGIN_WARN (IFNET_PLUGIN_NAME, + "Monitoring %s failed, error: %s", filename, diff --git a/system-settings/plugins/ifnet/wpa_parser.c b/system-settings/plugins/ifnet/wpa_parser.c -index 42c52c3..2c3869e 100644 +index 42c52c3..338c338 100644 --- a/system-settings/plugins/ifnet/wpa_parser.c +++ b/system-settings/plugins/ifnet/wpa_parser.c -@@ -468,7 +468,8 @@ wpa_set_data (gchar * ssid, gchar * key, gchar * value) +@@ -463,12 +463,15 @@ wpa_set_data (gchar * ssid, gchar * key, gchar * 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)) ++ if (new_value && !strcmp(orig_value, new_value)){ ++ g_free (new_value); + return; ++ } g_hash_table_remove (security, orig_key); g_free (orig_key); g_free (orig_value); diff --git a/net-misc/networkmanager/networkmanager-0.8.2-r8.ebuild b/net-misc/networkmanager/networkmanager-0.8.2-r8.ebuild new file mode 100644 index 000000000000..7c1c488f662d --- /dev/null +++ b/net-misc/networkmanager/networkmanager-0.8.2-r8.ebuild @@ -0,0 +1,165 @@ +# 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-r8.ebuild,v 1.1 2011/02/26 05:59:00 qiaomuf Exp $ + +EAPI="2" + +inherit autotools eutils 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() { + # FIXME. Required by -confchanges.patch, but the patch is invalid as + # ConsoleKit and PolicyKit is enough to get authorization. + enewgroup plugdev + + 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 + # fix parsing dhclient.conf wrt bug #352638 + epatch "${FILESDIR}/${P}-shared-connection.patch" + # Backports #1 + epatch "${FILESDIR}/${P}-1.patch" + # won't crash upon startup for 32bit machines wrt bug #353807 + epatch "${FILESDIR}/${P}-fix-timestamp.patch" + # fix tests wrt bug #353549 + epatch "${FILESDIR}/${P}-fix-tests.patch" + # fix temporary files creation bug #349003 + epatch "${FILESDIR}/${P}-fix-tempfiles.patch" + # won't write when nothing changed (bug #356339) + epatch "${FILESDIR}/${P}-ifnet-smarter-write.patch" + eautoreconf +} + +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 "" +} |