Commit 72baf9fa authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

manager: AddAndActivateConnection(): don't save until the connection is activatable

https://bugzilla.redhat.com/show_bug.cgi?id=1174164
parent 067202b3
......@@ -3017,6 +3017,7 @@ activation_add_done (NMSettings *self,
nm_active_connection_set_connection (info->active, NM_CONNECTION (new_connection));
if (_internal_activate_generic (info->manager, info->active, &local)) {
nm_settings_connection_commit_changes (new_connection, NULL, NULL);
dbus_g_method_return (context,
nm_connection_get_path (NM_CONNECTION (new_connection)),
nm_active_connection_get_path (info->active));
......@@ -3027,6 +3028,7 @@ activation_add_done (NMSettings *self,
g_assert (error);
_internal_activation_failed (info->manager, info->active, error->message);
nm_settings_connection_delete (new_connection, NULL, NULL);
dbus_g_method_return_error (context, error);
g_clear_error (&local);
......@@ -3056,7 +3058,7 @@ _add_and_activate_auth_done (NMActiveConnection *active,
/* Basic sender auth checks performed; try to add the connection */
nm_settings_add_connection_dbus (priv->settings,
nm_active_connection_get_connection (active),
TRUE,
FALSE,
context,
activation_add_done,
info);
......
......@@ -1119,7 +1119,7 @@ pk_add_cb (NMAuthChain *chain,
NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self);
NMAuthCallResult result;
GError *error = NULL;
NMConnection *connection;
NMConnection *connection = NULL;
NMSettingsConnection *added = NULL;
NMSettingsAddCallback callback;
gpointer callback_data;
......@@ -1159,7 +1159,7 @@ pk_add_cb (NMAuthChain *chain,
callback (self, added, error, context, callback_data);
/* Send agent-owned secrets to the agents */
if (!error && added)
if (!error && added && nm_settings_has_connection (self, added))
send_agent_owned_secrets (self, added, subject);
g_clear_error (&error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment