Verify mappings for NS_ERROR_* errors in nsLocalFileWin.cpp
Categories
(Core :: XPCOM, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: jstutte, Assigned: jan.rio.krause)
References
Details
Attachments
(3 files)
ConvertWinError makes some mappings that might be unexpected. Examples (non exhaustive and TBD):
Windows error | NS_ERROR_* | |
---|---|---|
ERROR_NOT_READY | NS_ERROR_FILE_NOT_FOUND | "The device is not ready." requires other mitigations/user actions than ERROR_FILE_NOT_FOUND. |
ERROR_NOT_SAME_DEVICE | NS_ERROR_FILE_ACCESS_DENIED | This error should occur only during file move of hard linked files between devices. The relation to denied access is not clear. |
ERROR_INVALID_BLOCK | NS_ERROR_OUT_OF_MEMORY | "The storage control block address is invalid." seems not very related to memory. |
ERROR_INVALID_HANDLE | NS_ERROR_OUT_OF_MEMORY | I would expect this to be handled by the abstraction layer and never be exposed as an error. Thus if it still occurs it would be something like NS_ERROR_INTERNAL_ERROR, IMHO |
ERROR_ARENA_TRASHED | NS_ERROR_OUT_OF_MEMORY | Also this looks more like a UAF of something inside the abstraction layer and thus an NS_ERROR_INTERNAL_ERROR? |
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
Windows error | NS_ERROR_* | |
---|---|---|
ERROR_CANNOT_MAKE |
NS_ERROR_FILE_ALREADY_EXISTS |
"The directory or file cannot be created." does not seem related to an already existing file, that has its own error. And mingw maps it to EACCES , thus NS_ERROR_FILE_ACCESS_DENIED seems more appropriate. |
Reporter | ||
Comment 2•4 years ago
|
||
I'd propose the following mappings:
Windows error | NS_ERROR_* | |
---|---|---|
ERROR_NOT_READY | NS_ERROR_FILE_DEVICE_TEMPORARY _FAILURE (new) | "The device is not ready." is hopefully a temporary condition and we might want to mitigate this with retrys. |
ERROR_NOT_SAME_DEVICE | NS_ERROR_FILE_NOT_FOUND (exists) | This error should occur only during file move of hard linked files between devices. In the end the file does not exist for us. Caveat: We might fail if we want to create it afterwards with the same filename. |
ERROR_INVALID_BLOCK | NS_ERROR_INVALID_HANDLE (new) | "The storage control block address is invalid." means probably we are trying to use an old handle. |
ERROR_INVALID_HANDLE | NS_ERROR_INVALID_HANDLE (new) | Self explaining. |
ERROR_ARENA_TRASHED | NS_ERROR_INVALID_HANDLE (new) | Also this looks more like a UAF of something, though I am not 100% sure what can cause this. |
ERROR_CANNOT_MAKE | NS_ERROR_FILE_ACCESS_DENIED (exists) | "The directory or file cannot be created." |
Comment 3•3 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:nika, maybe it's time to close this bug?
Reporter | ||
Comment 4•3 years ago
|
||
Not sure why we had the leave-open flag here - we did not land a single patch, yet.
Jan-Rio, given your current work on other error mappings, might you want to take a look also here? Thanks
Reporter | ||
Comment 5•3 years ago
•
|
||
The work here should probably include a check, if and how eventual callers reacted on the old error values and if we should thus make them aware of the new ones. And the mappings are just a proposal and might need further reasoning.
Assignee | ||
Comment 6•3 years ago
|
||
I will take care of it.
Assignee | ||
Comment 7•3 years ago
|
||
Assignee | ||
Comment 8•3 years ago
|
||
Depends on D130905
Assignee | ||
Comment 9•3 years ago
|
||
Depends on D130906
Assignee | ||
Comment 10•3 years ago
|
||
After discussing with Jens, we decided to not change ERROR_NOT_SAME_DEVICE
at the moment. The documentation says "The system cannot move the file to a different disk drive.", so the proposal to map it to NS_ERROR_FILE_NOT_FOUND
(see comment 2) does not fit perfectly.
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/faab6442b9d2
https://hg.mozilla.org/mozilla-central/rev/a9410a641017
https://hg.mozilla.org/mozilla-central/rev/24e488b549be
Description
•