mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-04 14:10:35 +01:00
clients: fix matching of connection path
Since we use g_str_has_prefix() to match a request_id with the connection path, there can be wrong matches. For example: request_id: /org/freedesktop/NetworkManager/Settings/10/802-1x connection: /org/freedesktop/NetworkManager/Settings/1 would match. Add a trailing slash to the connection path stored in the agent to prevent this.
This commit is contained in:
parent
f3099db28e
commit
f666efed0d
1 changed files with 10 additions and 2 deletions
|
|
@ -751,10 +751,18 @@ nm_secret_agent_simple_enable (NMSecretAgentSimple *self, const char *path)
|
|||
{
|
||||
NMSecretAgentSimplePrivate *priv = NM_SECRET_AGENT_SIMPLE_GET_PRIVATE (self);
|
||||
GList *requests, *iter;
|
||||
gs_free char *path_full = NULL;
|
||||
|
||||
if (g_strcmp0 (path, priv->path) != 0) {
|
||||
/* The path is only used to match a request_id with the current
|
||||
* connection. Since the request_id is "${CONNECTION_PATH}/${SETTING}",
|
||||
* add a trailing '/' to the path to match the full connection path.
|
||||
*/
|
||||
path_full = path ? g_strdup_printf ("%s/", path) : NULL;
|
||||
|
||||
if (g_strcmp0 (path_full, priv->path) != 0) {
|
||||
g_free (priv->path);
|
||||
priv->path = g_strdup (path);
|
||||
priv->path = path_full;
|
||||
path_full = NULL;
|
||||
}
|
||||
|
||||
if (priv->enabled)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue