summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-11-02 15:26:07 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2017-11-02 15:26:07 +0100
commit4a9ec4d39bd912d925c86e38efd33b7f43e6a39c (patch)
treee01079dc0ea3a60b3d8512b5924379d96fa18163
parent28b97f02f64ecf94e22c8929dfd0ba64151bd9d3 (diff)
parent61b666902b0797bf75664d0908661a4fbee0b9c2 (diff)
downloadNetworkManager-4a9ec4d39bd912d925c86e38efd33b7f43e6a39c.tar.gz
clients: merge branch 'bg/cli-agent-race-rh1438476'
https://bugzilla.redhat.com/show_bug.cgi?id=1438476
-rw-r--r--clients/cli/connections.c14
-rw-r--r--clients/common/nm-secret-agent-simple.c7
2 files changed, 16 insertions, 5 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 73c1de2644..c05a9e82fc 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -2397,10 +2397,6 @@ nmc_activate_connection (NmCli *nmc,
NM_SECRET_AGENT_SIMPLE_REQUEST_SECRETS,
G_CALLBACK (nmc_secrets_requested),
nmc);
- if (connection) {
- nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (nmc->secret_agent),
- nm_object_get_path (NM_OBJECT (connection)));
- }
}
info = g_malloc0 (sizeof (ActivateConnectionInfo));
@@ -6182,6 +6178,7 @@ typedef struct {
NMDevice *device;
NMActiveConnection *ac;
guint monitor_id;
+ NmCli *nmc;
} MonitorACInfo;
static gboolean nmc_editor_cb_called;
@@ -6259,6 +6256,14 @@ progress_activation_editor_cb (gpointer user_data)
goto finish; /* we are done */
}
+ if (info->nmc->secret_agent) {
+ NMRemoteConnection *connection;
+
+ connection = nm_active_connection_get_connection (ac);
+ nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (info->nmc->secret_agent),
+ nm_object_get_path (NM_OBJECT (connection)));
+ }
+
return TRUE;
finish:
@@ -6294,6 +6299,7 @@ activate_connection_editor_cb (GObject *client,
monitor_ac_info->device = g_object_ref (device);
monitor_ac_info->ac = active;
monitor_ac_info->monitor_id = g_timeout_add (120, progress_activation_editor_cb, monitor_ac_info);
+ monitor_ac_info->nmc = info->nmc;
} else
g_object_unref (active);
}
diff --git a/clients/common/nm-secret-agent-simple.c b/clients/common/nm-secret-agent-simple.c
index c08f7fe244..4ef1be239a 100644
--- a/clients/common/nm-secret-agent-simple.c
+++ b/clients/common/nm-secret-agent-simple.c
@@ -748,7 +748,12 @@ nm_secret_agent_simple_cancel_get_secrets (NMSecretAgentOld *agent,
const gchar *connection_path,
const gchar *setting_name)
{
- /* We don't support cancellation. Sorry! */
+ NMSecretAgentSimple *self = NM_SECRET_AGENT_SIMPLE (agent);
+ NMSecretAgentSimplePrivate *priv = NM_SECRET_AGENT_SIMPLE_GET_PRIVATE (self);
+ gs_free char *request_id = NULL;
+
+ request_id = g_strdup_printf ("%s/%s", connection_path, setting_name);
+ g_hash_table_remove (priv->requests, request_id);
}
static void