nsLocalFile::CreateAllAncestors fails for veiled paths
Categories
(Core :: XPCOM, defect, P5)
Tracking
()
Tracking | Status | |
---|---|---|
firefox89 | --- | fixed |
People
(Reporter: mrrjj, Assigned: mrrjj)
Details
Attachments
(1 file)
When creating a new profile, Firefox fails to create the "~/.mozilla/firefox/<profile>/storage/permanent" folder. I have observed this behavior with Firefox 85, 86, and 78esr, but the responsible code goes all the way back to Netscape.
The two most obvious symptoms of this failure are the browser's Web Developer tools showing no page source in the Inspector tab (non-78esr) and various error messages in the Browser Console relating to IndexedDB.
When creating a profile, nsLocalFile::CreateAllAncestors begins checking each directory in the path "/home/<user>/.mozilla/firefox/<profile>/storage/permanent" for existence (i.e., "/home" then "/home/<user>" then ...). Since "/home" is veiled to Firefox, the existence check fails and nsLocalFile::CreateAllAncestors gives up. Thus the "permanent" folder is never created despite "/home/<user>/.mozilla/firefox/<profile>" being unveiled to Firefox.
Instead nsLocalFile::CreateAllAncestors should attempt to create every directory in the path, and the success of the call should depend only on the outcome of creating the final directory.
![]() |
Assignee | |
Comment 1•3 years ago
|
||
Some systems hide path components. Determine access by creating the whole path.
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Note to anyone looking at this issue: like bug #1696958 this happens because the peculiarities from sandboxing on OpenBSD via unveil() are very specific to our OS, as (to my knowledge) sandboxing on other OSes dont hide parts of the filesystem.
As for the patch itself, the logic sounds sane to me, but there might be dragons in there.
Updated•3 years ago
|
Comment 3•3 years ago
|
||
Pushed by gpascutto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c41a7b705276 Have nsLocalFile::CreateAllAncestors make each path component. r=xpcom-reviewers,kmag
Comment 5•3 years ago
|
||
bugherder |
Description
•