Closed
Bug 652850
Opened 13 years ago
Closed 13 years ago
SafeInstallOperation can't rollback move/rename operations
Categories
(Toolkit :: Add-ons Manager, defect)
Toolkit
Add-ons Manager
Tracking
()
VERIFIED
FIXED
mozilla6
People
(Reporter: ma1, Assigned: mossop)
References
Details
(Whiteboard: [tests on bug 653835])
Attachments
(1 file)
896 bytes,
patch
|
robert.strong.bugs
:
review+
|
Details | Diff | Splinter Review |
While investigating code possibly involved with bug 644856, I've found http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm#201 is probably incorrect: this._installedFiles.push({ oldFile: null, newFile: newFile }); should be actually this._installedFiles.push({ oldFile: oldFile, newFile: newFile }); otherwise http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm#188 is meaningless and the oldFile variable useless. The effect of the current code is that move/rename operations cannot be rolled back because the original path gets lost.
Assignee | ||
Comment 1•13 years ago
|
||
Well damn, good catch. Going to have to think of how I can do proper testing here, simulating file move failures isn't easy though
Reporter | ||
Comment 2•13 years ago
|
||
(In reply to comment #1) > simulating file > move failures isn't easy though Wouldn't moving to a surely non-existent path always fail?
Assignee | ||
Updated•13 years ago
|
Attachment #528345 -
Flags: review? → review?(robert.bugzilla)
Assignee | ||
Comment 3•13 years ago
|
||
(In reply to comment #2) > (In reply to comment #1) > > simulating file > > move failures isn't easy though > > Wouldn't moving to a surely non-existent path always fail? Yes, but the code always erases the target path and recreates it as it moves the files. If I do something to make the target always unwritable then we'd never get to the SafeInstallOperation code. I think I can create some fake nsIFile instances to simulate failing to move a specific file, but I need to play around with it.
Comment 4•13 years ago
|
||
Comment on attachment 528345 [details] [diff] [review] patch rev 1 Might be able to test this on Windows by using a file stream. File a followup for tests?
Attachment #528345 -
Flags: review?(robert.bugzilla) → review+
Assignee | ||
Comment 5•13 years ago
|
||
This landed yesterday: http://hg.mozilla.org/mozilla-central/rev/e4e42dac5104 Bug for tests: bug 653835
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
Comment 6•13 years ago
|
||
Verified fixed by check-in (merge) on aurora. I will also connect the corresponding bug for the tests and set the in-testsuite? flag, so we do not forget about it.
Blocks: 653835
Status: RESOLVED → VERIFIED
Flags: in-testsuite?
Flags: in-litmus-
Whiteboard: [tests on bug 653835]
You need to log in
before you can comment on or make changes to this bug.
Description
•