Firefox won't delete key3.db if the profile path contains non-ASCII string on Windows
Categories
(Core :: Security: PSM, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: emk, Assigned: emk)
References
Details
Attachments
(1 file)
GetNSSProfilePath
will make a UTF-8 file path on Windows:
https://searchfox.org/mozilla-central/rev/a92ed79b0bc746159fc31af1586adbfa9e45e264/security/manager/ssl/nsNSSComponent.cpp#1413-1425
But MaybeCleanUpOldNSSFiles
> GetFileIfExists
passes the string to InitWithNativePath
that expects ANSI encoded file paths:
https://searchfox.org/mozilla-central/rev/a92ed79b0bc746159fc31af1586adbfa9e45e264/security/manager/ssl/nsNSSComponent.cpp#1545
GetFileIfExists
should convert the profile path to UTF-16 and use InitWithPath
.
Comment 1•4 years ago
|
||
See also bug 1607542. Not sure if mozilla-central still needs this fix.
Should this be fixed on esr68 ?
Comment 2•4 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #0)
GetFileIfExists
should convert the profile path to UTF-16
How?
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
•
|
||
Something like:
#ifdef XP_WIN
// |path| is encoded in UTF-8 because SQLite always takes UTF-8 file paths
// regardless of the current system code page.
nsresult rv = file->InitWithPath(NS_ConvertUTF8toUTF16(path));
#else
nsresult rv = file->InitWithNativePath(path);
#endif
Assignee | ||
Comment 4•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Pushed by VYV03354@nifty.ne.jp: https://hg.mozilla.org/integration/autoland/rev/f8b5627432c6 Handle non-ASCII profile path correctly when dealing with key3.db and pkcs11.txt on Windows. r=keeler
Comment 6•4 years ago
|
||
bugherder |
Description
•