diff options
author | Milan Crha <mcrha@redhat.com> | 2023-01-31 12:21:02 +0100 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2023-01-31 12:21:02 +0100 |
commit | 1bcb0b6196a624e0f99dc50d169d314f57abb286 (patch) | |
tree | b62ad900df8dbb893a08d526aaf132e1b61b4237 | |
parent | e82dc7abd077218dd4c36f645894054c9178f275 (diff) | |
download | gnome-online-accounts-1bcb0b6196a624e0f99dc50d169d314f57abb286.tar.gz |
goaowncloudprovider: Encode user name in calendar/contacts/files URI
The GUri is constructed with a flag claiming its parts are already encoded,
but when writing verbatim identity as a user name part, it can break parsing
the GUri back from a string when the identity contains special characters
like an `@`. Writing encoded identity to such GUri fixes the problem.
Closes https://gitlab.gnome.org/GNOME/gnome-online-accounts/-/issues/243
-rw-r--r-- | src/goabackend/goaowncloudprovider.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/goabackend/goaowncloudprovider.c b/src/goabackend/goaowncloudprovider.c index e36c702..977eb4b 100644 --- a/src/goabackend/goaowncloudprovider.c +++ b/src/goabackend/goaowncloudprovider.c @@ -175,10 +175,12 @@ build_object (GoaProvider *provider, if (uri != NULL) { GUri *tmp_uri; + gchar *encoded_identity; + encoded_identity = g_uri_escape_string (identity, NULL, FALSE); tmp_uri = g_uri_build_with_user (g_uri_get_flags (uri), g_uri_get_scheme (uri), - identity, + encoded_identity, g_uri_get_password (uri), g_uri_get_auth_params (uri), g_uri_get_host (uri), @@ -186,6 +188,7 @@ build_object (GoaProvider *provider, g_uri_get_path (uri), g_uri_get_query (uri), g_uri_get_fragment (uri)); + g_free (encoded_identity); g_uri_unref (uri); uri = tmp_uri; } |