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•5 years ago
|
||
See also bug 1607542. Not sure if mozilla-central still needs this fix.
Should this be fixed on esr68 ?
Comment 2•5 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #0)
GetFileIfExists
should convert the profile path to UTF-16
How?
Updated•5 years ago
|
Assignee | ||
Comment 3•5 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•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 6•5 years ago
|
||
bugherder |
Description
•