summaryrefslogtreecommitdiff
path: root/clients/common/nm-secret-agent-simple.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-02-09 08:26:21 +0100
committerThomas Haller <thaller@redhat.com>2019-02-14 08:00:29 +0100
commit6ef825d501adc771a525808e1e1b3b9515d1cc0b (patch)
treedd9363b9aa031daff5c829f11ffe1224d9229086 /clients/common/nm-secret-agent-simple.c
parent713e879d769f4aa95d1b15f5a584cc9cf4e9bd13 (diff)
downloadNetworkManager-6ef825d501adc771a525808e1e1b3b9515d1cc0b.tar.gz
clients/secret-agent: keep setting-name in request-data
It's not really used, but we shouldn't just forget about it. Currently, we fill requests only based on the connection-type, ignoring the setting-name. I guess, the concept of requesting secrets for a setting is utterly broken. But equally broken it is to just look at the connection (type). At least, don't just throw parts of the request away but keep it.
Diffstat (limited to 'clients/common/nm-secret-agent-simple.c')
-rw-r--r--clients/common/nm-secret-agent-simple.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clients/common/nm-secret-agent-simple.c b/clients/common/nm-secret-agent-simple.c
index 1393793e4c..f60d6cedf6 100644
--- a/clients/common/nm-secret-agent-simple.c
+++ b/clients/common/nm-secret-agent-simple.c
@@ -47,6 +47,7 @@ typedef struct {
NMSecretAgentSimple *self;
NMConnection *connection;
+ const char *setting_name;
char **hints;
NMSecretAgentOldGetSecretsFunc callback;
gpointer callback_data;
@@ -902,6 +903,7 @@ get_secrets (NMSecretAgentOld *agent,
RequestData *request;
gs_free_error GError *error = NULL;
gs_free char *request_id = NULL;
+ const char *request_id_setting_name;
request_id = g_strdup_printf ("%s/%s", connection_path, setting_name);
@@ -921,10 +923,15 @@ get_secrets (NMSecretAgentOld *agent,
return;
}
+ nm_assert (g_str_has_suffix (request_id, setting_name));
+ request_id_setting_name = &request_id[strlen (request_id) - strlen (setting_name)];
+ nm_assert (nm_streq (request_id_setting_name, setting_name));
+
request = g_slice_new (RequestData);
*request = (RequestData) {
.self = self,
.connection = g_object_ref (connection),
+ .setting_name = request_id_setting_name,
.hints = g_strdupv ((char **) hints),
.callback = callback,
.callback_data = callback_data,