Closed Bug 1443651 Opened 2 years ago Closed 2 years ago

CreateUnique should not return failure when files already exist

Categories

(Core :: XPCOM, defect)

60 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: kmag, Assigned: kmag)

Details

Attachments

(1 file)

CreateUnique currently only checks whether the failure code is NS_ERROR_FILE_ALREADY_EXISTS when trying to create a candidate filename. There are other ways that attempting to create an existing file can fail, particularly when that file is locked. When we get another failure code, we should check to see whether the file exists before treating it as a failure.
Comment on attachment 8956629 [details]
Bug 1443651: Don't return failure for access denied from createUnique() if file exists.

https://reviewboard.mozilla.org/r/225582/#review232200

Not a big fan of this approach but anything else is likely to be more complex than it is worth.
Attachment #8956629 - Flags: review?(dtownsend) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/e957efe5d14c0a7a79483b477e9a6c9a8e7ddb3f
Bug 1443651: Don't return failure for access denied from createUnique() if file exists. r=Mossop
https://hg.mozilla.org/mozilla-central/rev/e957efe5d14c
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.