summaryrefslogtreecommitdiff
path: root/clients/cli
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-01-22 12:51:10 +0100
committerThomas Haller <thaller@redhat.com>2019-02-05 08:27:42 +0100
commit93c848ca036d96396bbc5ecd9486b682f08b4fef (patch)
tree636453d7948c90b5d9751eae207fd23ee969d477 /clients/cli
parent82472c557cc966b14d3e1186605a7fc3e37dc17d (diff)
downloadNetworkManager-93c848ca036d96396bbc5ecd9486b682f08b4fef.tar.gz
clients: don't tread secret agent as NMSecretAgentOld
Most of the times we actually need a NMSecretAgentSimple typed pointer. This way, need need to cast less. But even if we would need to cast more, it's better to have pointers point to the actual type, not merely to avoid shortcomings of C.
Diffstat (limited to 'clients/cli')
-rw-r--r--clients/cli/agent.c2
-rw-r--r--clients/cli/common.c2
-rw-r--r--clients/cli/connections.c5
-rw-r--r--clients/cli/devices.c2
-rw-r--r--clients/cli/nmcli.c2
-rw-r--r--clients/cli/nmcli.h4
6 files changed, 8 insertions, 9 deletions
diff --git a/clients/cli/agent.c b/clients/cli/agent.c
index 05cc5dca5a..55a5ba6b85 100644
--- a/clients/cli/agent.c
+++ b/clients/cli/agent.c
@@ -149,7 +149,7 @@ do_agent_secret (NmCli *nmc, int argc, char **argv)
/* We keep running */
nmc->should_wait++;
- nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (nmc->secret_agent), NULL);
+ nm_secret_agent_simple_enable (nmc->secret_agent, NULL);
g_signal_connect (nmc->secret_agent,
NM_SECRET_AGENT_SIMPLE_REQUEST_SECRETS,
G_CALLBACK (secrets_requested),
diff --git a/clients/cli/common.c b/clients/cli/common.c
index 85b5005e44..56e5062f52 100644
--- a/clients/cli/common.c
+++ b/clients/cli/common.c
@@ -778,7 +778,7 @@ nmc_secrets_requested (NMSecretAgentSimple *agent,
/* Unregister our secret agent on failure, so that another agent
* may be tried */
if (nmc->secret_agent) {
- nm_secret_agent_old_unregister (nmc->secret_agent, NULL, NULL);
+ nm_secret_agent_old_unregister (NM_SECRET_AGENT_OLD (nmc->secret_agent), NULL, NULL);
g_clear_object (&nmc->secret_agent);
}
}
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index e2c23cb8c1..b8fac54e5c 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -2474,7 +2474,7 @@ check_activated (ActivateConnectionInfo *info)
if (nmc->secret_agent) {
NMRemoteConnection *connection = nm_active_connection_get_connection (info->active);
- nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (nmc->secret_agent),
+ nm_secret_agent_simple_enable (nmc->secret_agent,
nm_connection_get_path (NM_CONNECTION (connection)));
}
break;
@@ -2776,7 +2776,6 @@ nmc_activate_connection (NmCli *nmc,
g_hash_table_destroy (nmc->pwds_hash);
nmc->pwds_hash = pwds_hash;
- /* Create secret agent */
nmc->secret_agent = nm_secret_agent_simple_new ("nmcli-connect");
if (nmc->secret_agent) {
g_signal_connect (nmc->secret_agent,
@@ -6728,7 +6727,7 @@ progress_activation_editor_cb (gpointer user_data)
NMRemoteConnection *connection;
connection = nm_active_connection_get_connection (ac);
- nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (info->nmc->secret_agent),
+ nm_secret_agent_simple_enable (info->nmc->secret_agent,
nm_object_get_path (NM_OBJECT (connection)));
}
diff --git a/clients/cli/devices.c b/clients/cli/devices.c
index 44573fb649..d17cf79980 100644
--- a/clients/cli/devices.c
+++ b/clients/cli/devices.c
@@ -1961,7 +1961,7 @@ connect_device_cb (GObject *client, GAsyncResult *result, gpointer user_data)
if (nmc->secret_agent) {
NMRemoteConnection *connection = nm_active_connection_get_connection (active);
- nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (nmc->secret_agent),
+ nm_secret_agent_simple_enable (nmc->secret_agent,
nm_connection_get_path (NM_CONNECTION (connection)));
}
diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c
index a554a382a4..6d38a58857 100644
--- a/clients/cli/nmcli.c
+++ b/clients/cli/nmcli.c
@@ -1017,7 +1017,7 @@ nmc_cleanup (NmCli *nmc)
g_string_free (g_steal_pointer (&nmc->return_text), TRUE);
if (nmc->secret_agent) {
- nm_secret_agent_old_unregister (nmc->secret_agent, NULL, NULL);
+ nm_secret_agent_old_unregister (NM_SECRET_AGENT_OLD (nmc->secret_agent), NULL, NULL);
g_clear_object (&nmc->secret_agent);
}
diff --git a/clients/cli/nmcli.h b/clients/cli/nmcli.h
index 0ccf1653d8..cd50333a99 100644
--- a/clients/cli/nmcli.h
+++ b/clients/cli/nmcli.h
@@ -20,7 +20,7 @@
#ifndef NMC_NMCLI_H
#define NMC_NMCLI_H
-#include "nm-secret-agent-old.h"
+#include "nm-secret-agent-simple.h"
#include "nm-meta-setting-desc.h"
struct _NMPolkitListener;
@@ -129,7 +129,7 @@ typedef struct _NmCli {
int timeout; /* Operation timeout */
- NMSecretAgentOld *secret_agent; /* Secret agent */
+ NMSecretAgentSimple *secret_agent; /* Secret agent */
GHashTable *pwds_hash; /* Hash table with passwords in passwd-file */
struct _NMPolkitListener *pk_listener; /* polkit agent listener */