diff options
Diffstat (limited to 'clients/cli/connections.c')
-rw-r--r-- | clients/cli/connections.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 7abfa28a0a..b0844df83e 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -617,17 +617,17 @@ get_ac_for_connection (const GPtrArray *active_cons, NMConnection *connection) } static void -update_secrets_in_connection (NMRemoteConnection *con) +update_secrets_in_connection (NMRemoteConnection *rem_con, NMConnection *con) { GVariant *secrets; int i; GError *error = NULL; for (i = 0; nmc_fields_settings_names[i].name; i++) { - secrets = nm_remote_connection_get_secrets (con, nmc_fields_settings_names[i].name, NULL, NULL); + secrets = nm_remote_connection_get_secrets (rem_con, nmc_fields_settings_names[i].name, NULL, NULL); if (secrets) { g_printerr ("Updating secrets for %s\n", nmc_fields_settings_names[i].name); - (void) nm_connection_update_secrets (NM_CONNECTION (con), NULL, secrets, &error); + (void) nm_connection_update_secrets (con, NULL, secrets, &error); if (error) { g_printerr ("Error updating secrets: %s\n", error->message); g_error_free (error); @@ -1451,7 +1451,7 @@ do_connections_show (NmCli *nmc, gboolean active_only, gboolean show_secrets, if (con) { nmc->required_fields = profile_flds; if (show_secrets) - update_secrets_in_connection (NM_REMOTE_CONNECTION (con)); + update_secrets_in_connection (NM_REMOTE_CONNECTION (con), con); res = nmc_connection_profile_details (con, nmc, show_secrets); nmc->required_fields = NULL; if (!res) @@ -8027,14 +8027,14 @@ do_connection_edit (NmCli *nmc, int argc, char **argv) goto error; } - /* Merge secrets into the connection */ - update_secrets_in_connection (NM_REMOTE_CONNECTION (found_con)); - /* Duplicate the connection and use that so that we need not * differentiate existing vs. new later */ connection = nm_simple_connection_new_clone (found_con); + /* Merge secrets into the connection */ + update_secrets_in_connection (NM_REMOTE_CONNECTION (found_con), connection); + s_con = nm_connection_get_setting_connection (connection); g_assert (s_con); connection_type = nm_setting_connection_get_connection_type (s_con); |