summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-03-17 20:14:22 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-03-17 20:14:22 +0100
commit6cbe27d1498666c410a3df1fe81b725f9a4056a0 (patch)
treeff627c6a44e21a1e755bffd74c330be369efec8a /security
parent09abc10635f7f2d5aa9d918386b8a34590b8443a (diff)
downloadUXP-6cbe27d1498666c410a3df1fe81b725f9a4056a0.tar
UXP-6cbe27d1498666c410a3df1fe81b725f9a4056a0.tar.gz
UXP-6cbe27d1498666c410a3df1fe81b725f9a4056a0.tar.lz
UXP-6cbe27d1498666c410a3df1fe81b725f9a4056a0.tar.xz
UXP-6cbe27d1498666c410a3df1fe81b725f9a4056a0.zip
Issue #1467 - Part 3: Use UTF-8 file paths for NSS-SQL database.
Diffstat (limited to 'security')
-rw-r--r--security/manager/ssl/nsNSSComponent.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp
index d505b8aba..6d1e3c5f7 100644
--- a/security/manager/ssl/nsNSSComponent.cpp
+++ b/security/manager/ssl/nsNSSComponent.cpp
@@ -1706,16 +1706,25 @@ GetNSSProfilePath(nsAutoCString& aProfilePath)
}
#if defined(XP_WIN)
- // Native path will drop Unicode characters that cannot be mapped to system's
- // codepage, using short (canonical) path as workaround.
nsCOMPtr<nsILocalFileWin> profileFileWin(do_QueryInterface(profileFile));
if (!profileFileWin) {
MOZ_LOG(gPIPNSSLog, LogLevel::Error,
("Could not get nsILocalFileWin for profile directory.\n"));
return NS_ERROR_FAILURE;
}
+#ifdef NSS_SQLSTORE
+ // SQLite always takes UTF-8 file paths regardless of the current system
+ // code page.
+ nsAutoString u16ProfilePath;
+ rv = profileFileWin->GetCanonicalPath(u16ProfilePath);
+ CopyUTF16toUTF8(u16ProfilePath, aProfilePath);
+#else
+ // Native path will drop Unicode characters that cannot be mapped to system's
+ // codepage, using short (canonical) path as workaround.
rv = profileFileWin->GetNativeCanonicalPath(aProfilePath);
+#endif
#else
+ // On non-Windows, just get the native profile path.
rv = profileFile->GetNativePath(aProfilePath);
#endif