[network-manager-applet] libnma: unescape certificate paths in URIs
- From: Beniamino Galvani <bgalvani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] libnma: unescape certificate paths in URIs
- Date: Mon, 5 Mar 2018 20:51:36 +0000 (UTC)
commit 2a65e932dbcc8add0f8006451f59004e5eeb6f09
Author: Beniamino Galvani <bgalvani redhat com>
Date: Sun Mar 4 14:59:01 2018 +0100
libnma: unescape certificate paths in URIs
When the URI is a filesystem path, we want to return the unescaped
value ready to be used as a file name.
Note: value_with_scheme_to_uri() does not need a g_uri_escape_string()
because it seems file URIs can contain any character after "file://".
Fixes: 0da2398042bd8dccfdf63abf76b4d6b0679e4803
https://bugzilla.gnome.org/show_bug.cgi?id=793910
src/libnma/nma-cert-chooser.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/libnma/nma-cert-chooser.c b/src/libnma/nma-cert-chooser.c
index 8d78141..0461dce 100644
--- a/src/libnma/nma-cert-chooser.c
+++ b/src/libnma/nma-cert-chooser.c
@@ -101,7 +101,7 @@ uri_to_value_with_scheme (const gchar *uri, NMSetting8021xCKScheme *scheme)
return NULL;
} else if (g_str_has_prefix (uri, NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH)) {
*scheme = NM_SETTING_802_1X_CK_SCHEME_PATH;
- return g_strdup (uri + sizeof (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH) - 1);
+ return g_uri_unescape_string (uri + NM_STRLEN (NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PATH),
NULL);
} else if (g_str_has_prefix (uri, NM_SETTING_802_1X_CERT_SCHEME_PREFIX_PKCS11)) {
*scheme = NM_SETTING_802_1X_CK_SCHEME_PKCS11;
return g_strdup (uri);
@@ -131,7 +131,7 @@ uri_to_value_with_scheme (const gchar *uri, NMSetting8021xCKScheme *scheme)
}
g_return_val_if_fail (g_str_has_prefix (uri, "file://"), NULL);
- return g_strdup (uri + 7);
+ return g_uri_unescape_string (uri + 7, NULL);
}
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]