about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJeremy Bicha <jbicha@ubuntu.com>2018-02-23 16:04:35 -0500
committerJeremy Bicha <jbicha@ubuntu.com>2018-02-23 16:04:35 -0500
commit953e5822b886e8e3e242b4033db8047d9811c31c (patch)
tree3599c20b766932916cb6d8823abc889167bb1e22
parent68cf091b9a56aa4a2d9ac09815a1fef05ae83f74 (diff)
Cherry-pick patch to fix double prompt for wifi password on Kubuntu (LP: #1572244)
-rw-r--r--debian/changelog5
-rw-r--r--debian/patches/series1
-rw-r--r--debian/patches/settings-preserve-agent-owned-secrets-on-connection-updat.patch60
3 files changed, 66 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index a5137f92..9df202e4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,12 @@
 network-manager (1.10.4-1ubuntu2) UNRELEASED; urgency=medium
 
+  [ Bryan Quigley ]
   * debian/tests/urfkill-integration - don't stop/start network manager
 
+  [ Jeremy Bicha ]
+  * Cherry-pick patch from 1.10 branch to fix double prompt for wifi password
+    on Kubuntu (LP: #1572244)
+
  -- Bryan Quigley <bryan.quigley@canonical.com>  Fri, 23 Feb 2018 13:52:48 -0500
 
 network-manager (1.10.4-1ubuntu1) bionic; urgency=medium
diff --git a/debian/patches/series b/debian/patches/series
index 08302ead..163b39b4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ Disable-general-with-expect.patch
 libnm-Check-self-still-NMManager-or-not.patch
 #dns-manager-don-t-merge-split-DNS-search-domains.patch
 Read-system-connections-from-run.patch
+settings-preserve-agent-owned-secrets-on-connection-updat.patch
diff --git a/debian/patches/settings-preserve-agent-owned-secrets-on-connection-updat.patch b/debian/patches/settings-preserve-agent-owned-secrets-on-connection-updat.patch
new file mode 100644
index 00000000..8594c07c
--- /dev/null
+++ b/debian/patches/settings-preserve-agent-owned-secrets-on-connection-updat.patch
@@ -0,0 +1,60 @@
+From: Beniamino Galvani <bgalvani@redhat.com>
+Date: Wed, 14 Feb 2018 11:43:00 +0100
+Subject: settings: preserve agent-owned secrets on connection update
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: base64
+
+QWZ0ZXIgd3JpdGluZyB0aGUgY29ubmVjdGlvbiB0byBkaXNrIGFuZCByZXJlYWRpbmcgaXQsIGlu
+IGFkZGl0aW9uIHRvCnJlc3RvcmluZyBhZ2VudC1vd25lZCBzZWNyZXRzIGluIHRoZSBjYWNoZSB3
+ZSBtdXN0IGFsc28gcmVzdG9yZQphZ2VudC1vd25lZCBzZWNyZXRzIGZyb20gdGhlIG9yaWdpbmFs
+IGNvbm5lY3Rpb25zIHNpbmNlIHRoZXkgYXJlIGxvc3QKZHVyaW5nIHRoZSB3cml0ZS4KClJlcG9y
+dGVkLWJ5OiBNw6RydCBCYWtob2ZmIDxhbm9uQHNpZ2lsLnJlZD4KCmh0dHBzOi8vYnVnemlsbGEu
+Z25vbWUub3JnL3Nob3dfYnVnLmNnaT9pZD03OTMzMjQKKGNoZXJyeSBwaWNrZWQgZnJvbSBjb21t
+aXQgZjljNTBiZjNkM2UxZTUyZDU4MDNkNTVmYTk3YmY1NjkzMGZkMzAyMCkK
+---
+ src/settings/nm-settings-connection.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c
+index 37a0b3a..5862637 100644
+--- a/src/settings/nm-settings-connection.c
++++ b/src/settings/nm-settings-connection.c
+@@ -608,6 +608,7 @@ nm_settings_connection_update (NMSettingsConnection *self,
+ 	gboolean replaced = FALSE;
+ 	gs_free char *logmsg_change = NULL;
+ 	GError *local = NULL;
++	gs_unref_variant GVariant *con_agent_secrets = NULL;
+ 
+ 	g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (self), FALSE);
+ 
+@@ -658,9 +659,20 @@ nm_settings_connection_update (NMSettingsConnection *self,
+ 	    && !nm_connection_compare (NM_CONNECTION (self),
+ 	                               replace_connection,
+ 	                               NM_SETTING_COMPARE_FLAG_EXACT)) {
++		gs_unref_object NMConnection *simple = NULL;
++
+ 		if (log_diff_name)
+ 			nm_utils_log_connection_diff (replace_connection, NM_CONNECTION (self), LOGL_DEBUG, LOGD_CORE, log_diff_name, "++ ");
+ 
++		/* Make a copy of agent-owned secrets because they won't be present in
++		 * the connection returned by plugins, as plugins return only what was
++		 * reread from the file. */
++		simple = nm_simple_connection_new_clone (NM_CONNECTION (self));
++		nm_connection_clear_secrets_with_flags (simple,
++		                                        secrets_filter_cb,
++		                                        GUINT_TO_POINTER (NM_SETTING_SECRET_FLAG_AGENT_OWNED));
++		con_agent_secrets = nm_connection_to_dbus (simple, NM_CONNECTION_SERIALIZE_ONLY_SECRETS);
++
+ 		nm_connection_replace_settings_from_connection (NM_CONNECTION (self), replace_connection);
+ 
+ 		replaced = TRUE;
+@@ -688,6 +700,8 @@ nm_settings_connection_update (NMSettingsConnection *self,
+ 				g_variant_unref (dict);
+ 			}
+ 		}
++		if (con_agent_secrets)
++			(void) nm_connection_update_secrets (NM_CONNECTION (self), NULL, con_agent_secrets, NULL);
+ 	}
+ 
+ 	nm_settings_connection_recheck_visibility (self);