/[gentoo-x86]/net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch
Gentoo

Contents of /net-misc/networkmanager/files/networkmanager-0.9.2.0-ifnet-ignore-user-connections.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Sep 13 09:54:12 2012 UTC (23 months, 2 weeks ago) by tetromino
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Version bump with various fixes. No longer saves thousands of temporary ipv6 routes (bug #428274, thanks to Matthias Nagel). No longer installs dispatcher and init scripts when USE=systemd to avoid annoying systemd users (bug #434692, thanks to Arne St├Ącker). Drop old.

(Portage version: 2.2.0_alpha125/cvs/Linux x86_64)

1 From 022508394484dd1c66a57be565a2f9aa791f7a2f Mon Sep 17 00:00:00 2001
2 From: Mu Qiao <qiaomuf@gentoo.org>
3 Date: Thu, 15 Dec 2011 10:01:50 +0800
4 Subject: [PATCH 3/3] ifnet: ignore per-user connections
5
6 ---
7 src/settings/plugins/ifnet/plugin.c | 46 +++++++++++++++++++++++++++++++----
8 1 files changed, 41 insertions(+), 5 deletions(-)
9
10 diff --git a/src/settings/plugins/ifnet/plugin.c b/src/settings/plugins/ifnet/plugin.c
11 index 5908368..14f2a90 100644
12 --- a/src/settings/plugins/ifnet/plugin.c
13 +++ b/src/settings/plugins/ifnet/plugin.c
14 @@ -180,7 +180,7 @@ monitor_file_changes (const char *filename,
15 /* Callback for nm_settings_connection_replace_and_commit. Report any errors
16 * encountered when commiting connection settings updates. */
17 static void
18 -commit_cb (NMSettingsConnection *connection, GError *error, gpointer unused)
19 +commit_cb (NMSettingsConnection *connection, GError *error, gpointer unused)
20 {
21 if (error) {
22 PLUGIN_WARN (IFNET_PLUGIN_NAME, " error updating: %s",
23 @@ -317,6 +317,26 @@ reload_connections (gpointer config)
24 g_list_free (conn_names);
25 }
26
27 +static void
28 +check_flagged_secrets (NMSetting *setting,
29 + const char *key,
30 + const GValue *value,
31 + GParamFlags flags,
32 + gpointer user_data)
33 +{
34 + gboolean *is_system_secret = user_data;
35 +
36 + if (flags & NM_SETTING_PARAM_SECRET) {
37 + NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE;
38 +
39 + nm_setting_get_secret_flags (setting, key, &secret_flags, NULL);
40 +
41 + if (secret_flags != NM_SETTING_SECRET_FLAG_NONE) {
42 + *is_system_secret = TRUE;
43 + }
44 + }
45 +}
46 +
47 static NMSettingsConnection *
48 add_connection (NMSystemConfigInterface *config,
49 NMConnection *source,
50 @@ -324,11 +344,27 @@ add_connection (NMSystemConfigInterface *config,
51 {
52 NMIfnetConnection *connection = NULL;
53 char *conn_name;
54 + gboolean has_flagged_secrets = FALSE;
55 + NMSettingConnection *settings = NM_SETTING_CONNECTION (
56 + nm_connection_get_setting (source, NM_TYPE_SETTING_CONNECTION));
57 +
58 + g_assert (settings);
59 + /* If the connection is not available for all users, ignore
60 + * it as this plugin only deals with System Connections */
61 + if (nm_setting_connection_get_num_permissions (settings))
62 + return NULL;
63 +
64 + /* If the connection has flagged secrets, ignore
65 + * it as this plugin does not deal with user agent service */
66 + nm_connection_for_each_setting_value (source, check_flagged_secrets, &has_flagged_secrets);
67 +
68 + if (!has_flagged_secrets) {
69 + conn_name = ifnet_add_new_connection (source, CONF_NET_FILE, WPA_SUPPLICANT_CONF, error);
70 + if (conn_name)
71 + connection = nm_ifnet_connection_new (conn_name, source);
72 + reload_connections (config);
73 + }
74
75 - conn_name = ifnet_add_new_connection (source, CONF_NET_FILE, WPA_SUPPLICANT_CONF, error);
76 - if (conn_name)
77 - connection = nm_ifnet_connection_new (conn_name, source);
78 - reload_connections (config);
79 return connection ? NM_SETTINGS_CONNECTION (connection) : NULL;
80 }
81
82 --
83 1.7.3.4

  ViewVC Help
Powered by ViewVC 1.1.20