Blame SOURCES/0021-rh1267672-nmtui-crash-with-secret-agent.patch

ab7d06
From 7c4f6915b0e5479c90bc666400f3674cff024acd Mon Sep 17 00:00:00 2001
ab7d06
From: Thomas Haller <thaller@redhat.com>
ab7d06
Date: Wed, 30 Sep 2015 17:25:49 +0200
ab7d06
Subject: [PATCH 1/2] tui: fix crash during activation when failed to create
ab7d06
 secret-agent
ab7d06
ab7d06
NetworkManager only allows one 'client:user-id' to register as secret
ab7d06
agent. Thus, when starting nmtui in two terminals, creating the secret
ab7d06
agent can fail.
ab7d06
ab7d06
This can lead to a crash.
ab7d06
ab7d06
https://bugzilla.gnome.org/show_bug.cgi?id=755883
ab7d06
(cherry picked from commit b861900d45da588f4239be418c3e1f62505cbde1)
ab7d06
(cherry picked from commit 269a4483be917fcc7ba66bcf061f75e76df0c6c7)
ab7d06
---
ab7d06
 clients/tui/nmtui-connect.c | 8 ++++----
ab7d06
 1 file changed, 4 insertions(+), 4 deletions(-)
ab7d06
ab7d06
diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c
ab7d06
index 438915d..5eabbc8 100644
ab7d06
--- a/clients/tui/nmtui-connect.c
ab7d06
+++ b/clients/tui/nmtui-connect.c
ab7d06
@@ -132,7 +132,7 @@ activate_connection (NMConnection *connection,
ab7d06
                      NMObject     *specific_object)
ab7d06
 {
ab7d06
 	NmtNewtForm *form;
ab7d06
-	NMSecretAgentOld *agent;
ab7d06
+	gs_unref_object NMSecretAgentOld *agent = NULL;
ab7d06
 	NmtNewtWidget *label;
ab7d06
 	NmtSyncOp op;
ab7d06
 	const char *specific_object_path;
ab7d06
@@ -188,7 +188,7 @@ activate_connection (NMConnection *connection,
ab7d06
 		goto done;
ab7d06
 	}
ab7d06
 
ab7d06
-	if (!connection) {
ab7d06
+	if (agent && !connection) {
ab7d06
 		connection = NM_CONNECTION (nm_active_connection_get_connection (ac));
ab7d06
 		if (connection) {
ab7d06
 			nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (agent),
ab7d06
@@ -220,8 +220,8 @@ activate_connection (NMConnection *connection,
ab7d06
 		nmt_newt_form_quit (form);
ab7d06
 	g_object_unref (form);
ab7d06
 
ab7d06
-	nm_secret_agent_old_unregister (agent, NULL, NULL);
ab7d06
-	g_object_unref (agent);
ab7d06
+	if (agent)
ab7d06
+		nm_secret_agent_old_unregister (agent, NULL, NULL);
ab7d06
 }
ab7d06
 
ab7d06
 static void
ab7d06
-- 
ab7d06
2.4.3
ab7d06
ab7d06
ab7d06
From 74a8e8c9e61f663bed05f004d5e9530c1ea1dbf5 Mon Sep 17 00:00:00 2001
ab7d06
From: Lubomir Rintel <lkundrak@v3.sk>
ab7d06
Date: Wed, 30 Sep 2015 19:37:10 +0200
ab7d06
Subject: [PATCH 2/2] tui: add a missing include to fix build
ab7d06
ab7d06
Fixes: 269a4483be917fcc7ba66bcf061f75e76df0c6c7
ab7d06
(cherry picked from commit e88161172e2d675783027a839b50488cc75fbf6f)
ab7d06
---
ab7d06
 clients/tui/nmtui-connect.c | 2 ++
ab7d06
 1 file changed, 2 insertions(+)
ab7d06
ab7d06
diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c
ab7d06
index 5eabbc8..cacb0b4 100644
ab7d06
--- a/clients/tui/nmtui-connect.c
ab7d06
+++ b/clients/tui/nmtui-connect.c
ab7d06
@@ -30,6 +30,8 @@
ab7d06
 
ab7d06
 #include <glib/gi18n-lib.h>
ab7d06
 
ab7d06
+#include "gsystem-local-alloc.h"
ab7d06
+
ab7d06
 #include "nmt-newt.h"
ab7d06
 
ab7d06
 #include "nmtui.h"
ab7d06
-- 
ab7d06
2.4.3
ab7d06