Make ifnet ignore user connections (bug #392409)
authorMu Qiao <qiaomuf@gentoo.org>
Thu, 5 Jan 2012 01:56:32 +0000 (01:56 +0000)
committerMu Qiao <qiaomuf@gentoo.org>
Thu, 5 Jan 2012 01:56:32 +0000 (01:56 +0000)
Thanks to David Narvaez for his great help on this problem.

Package-Manager: portage-2.1.10.43/cvs/Linux x86_64

net-misc/networkmanager/ChangeLog
net-misc/networkmanager/Manifest
net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch [new file with mode: 0644]
net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-remove-system-prefix.patch [new file with mode: 0644]
net-misc/networkmanager/networkmanager-0.9.2.0-r2.ebuild [moved from net-misc/networkmanager/networkmanager-0.9.2.0-r1.ebuild with 94% similarity]

index 28d514ec5611065b7c734f41e51f3d215e78d396..e1b7f8105a72e731c3358cecaccf136600313ff1 100644 (file)
@@ -1,6 +1,16 @@
 # 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.123 2011/12/16 20:36:08 tetromino Exp $
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/ChangeLog,v 1.124 2012/01/05 01:56:32 qiaomuf Exp $
+
+*networkmanager-0.9.2.0-r2 (05 Jan 2012)
+
+  05 Jan 2012; Mu Qiao <qiaomuf@gentoo.org> -networkmanager-0.9.2.0-r1.ebuild,
+  +networkmanager-0.9.2.0-r2.ebuild,
+  +files/networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch,
+  +files/networkmanager-0.9.2.0-ifnet-remove-system-prefix.patch:
+  Make ifnet ignore user connections (bug #392409)
+
+  Thanks to David Narvaez for his great help on this problem.
 
   16 Dec 2011; Alexandre Rostovtsev <tetromino@gentoo.org> metadata.xml:
   s/steev/tetromino/ in maintainers. Acked by Nirbheek and Steev.
index c460e30489dbc6da1cb533b8fc6c36235ce293ae..a92cf11d9737aac21d680309b12c999b611a4f38 100644 (file)
@@ -1,5 +1,5 @@
 -----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA256
+Hash: SHA1
 
 AUX 01-org.freedesktop.NetworkManager.settings.modify.system.pkla 187 RMD160 a6de26825439432c62cfaa7be847fa39181747fa SHA1 cae5a2c5d8ab0af2830f17e7fe375468c8d5b151 SHA256 909356b25e2d887a31c0f9f2a23a466957f27b163bbd5172fa852988a1db1860
 AUX NetworkManagerDispatcher 1198 RMD160 4345870ab40607b9aed80c8da383b604f032b98e SHA1 1dd2250c746b25566fceaab551f4ef8335fe4f55 SHA256 f8cb5d0470619cf1f0812fffcf1bf2091e3c44a757899c07164f80ddd6a2641e
@@ -13,7 +13,9 @@ AUX networkmanager-0.9.1.95-dns-routing-unmanaged-devices.patch 2740 RMD160 014d
 AUX networkmanager-0.9.1.95-force-libnl1.1.patch 1883 RMD160 fc6760cdcba81710c7232c536ee31276fe676062 SHA1 9bb1257b55f7a15d61f6c30d27ec7ded7c49da7a SHA256 1fb9d5bbda83e056c7ea53bcb5463f2f1b1c09d91b05a0df5fcfd948fb4c0007
 AUX networkmanager-0.9.1.95-glib-2.31.patch 4932 RMD160 6d20b856a4c3ce86cc15f10439ac437c1f70e0aa SHA1 2c773a16109e57eddb7bf8a1932c05eb3c5442a1 SHA256 b5a70e9a29d11a0455493d895abeb673042c7bcbc149c16a12b6f70ca8ab4912
 AUX networkmanager-0.9.1.95-keyfile-scheme.patch 927 RMD160 16ea59d436e300f5e453d1f9b027c67704d9ee6b SHA1 6ccf2538dba3e29c1210c6b843ececfd09542581 SHA256 0c1013afe0343a94f2584779737d6b1714c432564e967ca014ba5da552b3d283
+AUX networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch 3023 RMD160 aaba09baa8db58bd0924e9ebc364fe92b4692622 SHA1 5fb89802986120a1d3905775dd2669897fcc884d SHA256 e5f43915b13f17c0ad1acdd1c44bae377c60b7fe4210e5cc3c5fbac27f6ad9aa
 AUX networkmanager-0.9.2.0-ifnet-openrc-style.patch 18656 RMD160 deb7be203b56ba2029763bf34508db584d35df92 SHA1 bdfb8e2c4fadc129171f48eb99330c75354d65da SHA256 9ec9bd94159979ffd17221901299055ec3329886862cca564c9931a7b65fb616
+AUX networkmanager-0.9.2.0-ifnet-remove-system-prefix.patch 1939 RMD160 c06e5eeb31b537ab1ccd0ce0ee52b1fb2cf16a95 SHA1 d0a7d5bb6c69c7005f7f68b20b9421e433fe9d3d SHA256 7dda93bafcb3736ba4d037897a50116e005df47008389f3fee872c1fbd3eaf9f
 AUX networkmanager-0.9_rc3-fix-tests.patch 589 RMD160 a63f0d4f908a32356baf78c7e7c9a68cd9e4d68c SHA1 9f1ed4418b124bae89f9849ce2560dd713565abc SHA256 c03a97751762864dc4dcfa6d9eeee1ea70b986bcd5830a6777cd7514ba647540
 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
@@ -26,14 +28,18 @@ EBUILD networkmanager-0.8-r1.ebuild 3718 RMD160 abf962bc9f2368b13d28432994383e37
 EBUILD networkmanager-0.8.4.0-r2.ebuild 4335 RMD160 7f413e48de262b71f692c0585e2e70b64c467249 SHA1 8cd00862bac4a3218cbb45d011cb394d91563d97 SHA256 654a9a55d1683afa579df435df9df4b6d439c496c80900039773e5588433280d
 EBUILD networkmanager-0.9.0.ebuild 3945 RMD160 cd897dc8dc3fa92d4f4694a5acd703be6f9b5be1 SHA1 ef7eaa7e68bf01c2f4ea280742f30f856ef76ef6 SHA256 ab67f7f112c3b415c70f08b1ea9d6c029b7733203bafb512250e483b91c61bc8
 EBUILD networkmanager-0.9.1.95.ebuild 4926 RMD160 2a93cf7a8e56c5a5717dfbe44eb782c6a71efa94 SHA1 47cb6a9354dcc37eba1b56b286cbbd6d56fb1e7e SHA256 2beb60a101e6a8ee920b20f7ffa711f4250073cb10369d829e1c3f17b40fa8f1
-EBUILD networkmanager-0.9.2.0-r1.ebuild 4683 RMD160 e1716e1b9149a41c5aa8ad9e57b1b9baa1bc97a1 SHA1 d6d94db24c3ddfd5f4e8af237013a72060296a4c SHA256 fa3152516b00d9270adb85cafb498dcb524ba88610d85df477361f04e223d155
+EBUILD networkmanager-0.9.2.0-r2.ebuild 4861 RMD160 700e51efe25ed4fe00da6344f212a1ec58754a3e SHA1 4a0ec8619469fec3a2b4e3d6c67eb8b9bed368e3 SHA256 4a81d453993aa6c079550481235e0634dbd78865238dcabe145eca4cd742ebb7
 EBUILD networkmanager-0.9.2.0.ebuild 4603 RMD160 3debbefb4e568c8f9a88afbe99c9b396c23e2c8a SHA1 ac79b40c257c8f35785de76abd642dc57d3a2a42 SHA256 dc3ed6e10b182eaf4630e819a413c07a2193da9d2d575a4dac8ab2a443ead44e
-MISC ChangeLog 27404 RMD160 bbe5560f5e779f72aa8e1c1fc14754e5d4795f78 SHA1 180f1af28897d6ad67dd0288d26cd5939b7999a3 SHA256 6e8ffc68ffe6614394f82574222f7bc656dcec27a2afee937fa6446ae10995ad
+MISC ChangeLog 27810 RMD160 17eb57cfd74dabe296820e394b8dc1160c9f8557 SHA1 bc31ee55c0552c3b1e18108ddc374a26f8d6ad9c SHA256 1fe6ab3d115a6f73ff2dd459d32bf3787c93fda4a20da7f1f2ccfb01c0cc4d10
 MISC metadata.xml 1334 RMD160 f298cbf6adc22935891d30e834f5713d439a010d SHA1 c06b8992e77b4894a13b38890c4dfa62606d1d89 SHA256 59cb4c0eb37a25238b36f0b514ff4bc232e4df3666b5491b31a1d7265c1a0c37
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.18 (GNU/Linux)
+Version: GnuPG v2.0.17 (GNU/Linux)
 
-iF4EAREIAAYFAk7rq70ACgkQdjK8w9WeBnAgQwD/Scbg3ARe9HfKrF95Tz7tWfW7
-PdqrWbg89CWO8IIorrsA/0vhv+JC33lEqYmbDpFhasvDJ6z61UYZecFlVx8xhBgn
-=d6J3
+iQEcBAEBAgAGBQJPBQNcAAoJEDCzDeQXsVfpEzsIAJeb8kzrT5GIoU7+ycP8ig/H
+L1i4j6ICWO6y2tfNKlT6K+p1xIoCKPN7RYPjo148COYIN2MH83zqWc5rVs3l5AxT
+eyJZNSEZlieulTx55h1S+v/R+HtlfS9frZyNdGqRoUL9K0kTp1fTB/h1ZvR8tUVI
+nVay9EBK7yWRRiq0hiby5NC4OZ0OWnhW3dqdGBOpX2YrKFIDHaIix3nAvBC3Kx6z
+PvXxR833x3imIOrnmr7CowGdV3bGe4aezzMjRlLWNmdfLJ4zDj6Mgqd5uP0ZhG7u
+ekMqDxmVTQKzFYxNGO1iPMUSQIDrN3/NvPRY6ZMNaYx6gYe5ROiuPhIBAlBem3M=
+=6ZrJ
 -----END PGP SIGNATURE-----
diff --git a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch b/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch
new file mode 100644 (file)
index 0000000..73dc477
--- /dev/null
@@ -0,0 +1,84 @@
+From 022508394484dd1c66a57be565a2f9aa791f7a2f Mon Sep 17 00:00:00 2001
+From: Mu Qiao <qiaomuf@gentoo.org>
+Date: Thu, 15 Dec 2011 10:01:50 +0800
+Subject: [PATCH 3/3] ifnet: ignore per-user connections
+
+---
+ src/settings/plugins/ifnet/plugin.c |   46 +++++++++++++++++++++++++++++++----
+ 1 files changed, 41 insertions(+), 5 deletions(-)
+
+diff --git a/src/settings/plugins/ifnet/plugin.c b/src/settings/plugins/ifnet/plugin.c
+index 5908368..14f2a90 100644
+--- a/src/settings/plugins/ifnet/plugin.c
++++ b/src/settings/plugins/ifnet/plugin.c
+@@ -180,7 +180,7 @@ monitor_file_changes (const char *filename,
+ /* Callback for nm_settings_connection_replace_and_commit. Report any errors
+  * encountered when commiting connection settings updates. */
+ static void
+-commit_cb (NMSettingsConnection *connection, GError *error, gpointer unused) 
++commit_cb (NMSettingsConnection *connection, GError *error, gpointer unused)
+ {
+       if (error) {
+               PLUGIN_WARN (IFNET_PLUGIN_NAME, "    error updating: %s",
+@@ -317,6 +317,26 @@ reload_connections (gpointer config)
+       g_list_free (conn_names);
+ }
++static void
++check_flagged_secrets (NMSetting  *setting,
++                       const char *key,
++                       const GValue *value,
++                       GParamFlags flags,
++                       gpointer user_data)
++{
++      gboolean *is_system_secret = user_data;
++
++      if (flags & NM_SETTING_PARAM_SECRET) {
++              NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
++
++              nm_setting_get_secret_flags (setting, key, &secret_flags, NULL);
++
++              if (secret_flags != NM_SETTING_SECRET_FLAG_NONE) {
++                      *is_system_secret = TRUE;
++              }
++      }
++}
++
+ static NMSettingsConnection *
+ add_connection (NMSystemConfigInterface *config,
+                 NMConnection *source,
+@@ -324,11 +344,27 @@ add_connection (NMSystemConfigInterface *config,
+ {
+       NMIfnetConnection *connection = NULL;
+       char *conn_name;
++      gboolean has_flagged_secrets = FALSE;
++      NMSettingConnection *settings = NM_SETTING_CONNECTION (
++                      nm_connection_get_setting (source, NM_TYPE_SETTING_CONNECTION));
++
++      g_assert (settings);
++      /* If the connection is not available for all users, ignore
++       * it as this plugin only deals with System Connections */
++      if (nm_setting_connection_get_num_permissions (settings))
++              return NULL;
++
++      /* If the connection has flagged secrets, ignore
++       * it as this plugin does not deal with user agent service */
++      nm_connection_for_each_setting_value (source, check_flagged_secrets, &has_flagged_secrets);
++
++      if (!has_flagged_secrets) {
++              conn_name = ifnet_add_new_connection (source, CONF_NET_FILE, WPA_SUPPLICANT_CONF, error);
++              if (conn_name)
++                      connection = nm_ifnet_connection_new (conn_name, source);
++              reload_connections (config);
++      }
+-      conn_name = ifnet_add_new_connection (source, CONF_NET_FILE, WPA_SUPPLICANT_CONF, error);
+-      if (conn_name)
+-              connection = nm_ifnet_connection_new (conn_name, source);
+-      reload_connections (config);
+       return connection ? NM_SETTINGS_CONNECTION (connection) : NULL;
+ }
+-- 
+1.7.3.4
+
diff --git a/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-remove-system-prefix.patch b/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-remove-system-prefix.patch
new file mode 100644 (file)
index 0000000..1dcab2f
--- /dev/null
@@ -0,0 +1,57 @@
+From 145f86d0e98f5525e69a86c15be3f932104b5129 Mon Sep 17 00:00:00 2001
+From: Mu Qiao <qiaomuf@gentoo.org>
+Date: Thu, 22 Dec 2011 09:57:26 +0800
+Subject: [PATCH 4/4] ifnet: remove system prefix
+
+As all connections are system connection so the prefix is meaningless.
+Drop it now.
+---
+ po/POTFILES.in                                 |    1 -
+ src/settings/plugins/ifnet/connection_parser.c |   12 ++----------
+ 2 files changed, 2 insertions(+), 11 deletions(-)
+
+diff --git a/po/POTFILES.in b/po/POTFILES.in
+index f021275..20b60d3 100644
+--- a/po/POTFILES.in
++++ b/po/POTFILES.in
+@@ -26,6 +26,5 @@ src/nm-device-olpc-mesh.c
+ src/nm-manager.c
+ src/nm-netlink-monitor.c
+ src/settings/plugins/ifcfg-rh/reader.c
+-src/settings/plugins/ifnet/connection_parser.c
+ src/settings/nm-settings-utils.c
+diff --git a/src/settings/plugins/ifnet/connection_parser.c b/src/settings/plugins/ifnet/connection_parser.c
+index 66ce318..97bc7ff 100644
+--- a/src/settings/plugins/ifnet/connection_parser.c
++++ b/src/settings/plugins/ifnet/connection_parser.c
+@@ -45,12 +45,6 @@
+ #include "connection_parser.h"
+ #include "nm-ifnet-connection.h"
+-static const char *
+-get_prefix (void)
+-{
+-      return _("System");
+-}
+-
+ static void
+ update_connection_id (NMConnection *connection, const char *conn_name)
+ {
+@@ -62,11 +56,9 @@ update_connection_id (NMConnection *connection, const char *conn_name)
+       name_len = strlen (conn_name);
+       if ((name_len > 2) && (g_str_has_prefix (conn_name, "0x"))) {
+-              gchar * conn_name_printable = utils_hexstr2bin (conn_name + 2, name_len - 2);
+-              idstr = g_strdup_printf ("%s (%s)", get_prefix (), conn_name_printable);
+-              g_free (conn_name_printable);
++              idstr = utils_hexstr2bin (conn_name + 2, name_len - 2);
+       } else
+-              idstr = g_strdup_printf ("%s (%s)", get_prefix (), conn_name);
++              idstr = g_strdup_printf("%s", conn_name);
+       uuid_base = idstr;
+       uuid = nm_utils_uuid_generate_from_string (uuid_base);
+       setting =
+-- 
+1.7.3.4
+
similarity index 94%
rename from net-misc/networkmanager/networkmanager-0.9.2.0-r1.ebuild
rename to net-misc/networkmanager/networkmanager-0.9.2.0-r2.ebuild
index e63c16a003cdffcb6c3d63a963e613749ec440a4..d56319193ce3c56e8b1aac15ffa70a5970eca193 100644 (file)
@@ -1,6 +1,6 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.9.2.0-r1.ebuild,v 1.1 2011/12/07 03:08:53 qiaomuf Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.9.2.0-r2.ebuild,v 1.1 2012/01/05 01:56:32 qiaomuf Exp $
 
 EAPI="4"
 GNOME_ORG_MODULE="NetworkManager"
@@ -97,6 +97,10 @@ src_prepare() {
        epatch "${FILESDIR}/${PN}-0.9.1.95-force-libnl1.1.patch"
        # Migrate to openrc style
        epatch "${FILESDIR}/${P}-ifnet-openrc-style.patch"
+       # Ignore per-user connections
+       epatch "${FILESDIR}/${P}-ifnet-ignore-user-connections.patch"
+       # Remove system prefix
+       epatch "${FILESDIR}/${P}-ifnet-remove-system-prefix.patch"
 
        eautoreconf
        default