Closed
Bug 29415
Opened 25 years ago
Closed 24 years ago
XPInstall does not chmod read-only files so it can delete them
Categories
(Core Graveyard :: Installer: XPInstall Engine, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9
People
(Reporter: dveditz, Assigned: dbragg)
Details
(Whiteboard: [xpibug])
Attachments
(2 files)
1.62 KB,
patch
|
Details | Diff | Splinter Review | |
1.19 KB,
patch
|
Details | Diff | Splinter Review |
When xpinstall finds a file it should delete (whether to replace or simply to clean up) it schedules it for later attempts if the delete fails on the assumption that the file might be in use. In fact, the file might simply be marked read-only and we should first chmod it to writable and try again. On Unix we should perhaps check the ownership of the file to see if we'll ever be able to do anything to the file. There's no point in scheduling actions for later that we cannot ever perform.
Updated•25 years ago
|
Status: NEW → ASSIGNED
Updated•24 years ago
|
Priority: P3 → P1
Reporter | ||
Comment 4•24 years ago
|
||
Resetting target field for missed milestones
Target Milestone: M18 → ---
Reporter | ||
Comment 5•24 years ago
|
||
Reassigning, Don has other similar bugs to this
Assignee: sgehani → dbragg
Status: ASSIGNED → NEW
Whiteboard: [xpibug]
Posted patch. Samir brought up a good point in the review. I'm returning nsInstall::READ_ONLY instead of ACCESS_DENIED so that we don't try to schedule this file for deletion and never actually delete it. I did this based on the original comment in the bug but Samir pointed out that it may be the case where another process has set the attributes on the file and prevents us from changing them. In this case we should return ACCESS_DENIED so that when the other process releases or resets the attributes we'll be able to delete it. Please advise.
Reporter | ||
Comment 10•24 years ago
|
||
No, that's too late... We need to know in the Prepare() step whether this is going to fail or not so we can return a useful error message to the script at a time when the script can deal with it. The Prepare step should check permissions, if read-only change them right then, and if they can't be changed return an error ACCESS_DENIED right there. If we wanted to be nice we could store the fact the permissions were changed just in case of an Abort() so we can put it back. What's the bug number on SetPermissions not working on the Mac? This one will depend on that one because when we do OS X mac permissions come into play.
Assignee | ||
Comment 11•24 years ago
|
||
So what do you want to do with this Dan? It was left in the air after our discussion a week or so ago when we saw how thorny this is if you want to try to catch it in the Prepare phases. Do you want me to add it to all the Prepare phases that need it, (as we discussed it's more than one) or do we want to just go with this patch?
Assignee | ||
Comment 12•24 years ago
|
||
After discussing this somewhat sticky issue with Dan we came up with the following patch.
Assignee | ||
Comment 13•24 years ago
|
||
Comment 14•24 years ago
|
||
Patch looks good. Can you include the rationale?
Reporter | ||
Comment 15•24 years ago
|
||
Rather than try to cover all the bases where we might be able to chmod a read-only file (and detect the cases where we can't early enough to do any good) we decided that it's safer to simply respect the user's read-only settings and detect them at the ::Prepare() step. As an enhancement we could do similar detection in the File object methods, but in the meanwhile we're going to expose File.isWritable() to let script authors deal with it on their own when using the lower-level file commands.
Comment 16•24 years ago
|
||
sr=mscott
Assignee | ||
Comment 17•24 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 18•24 years ago
|
||
Build: 2001-04-09-11-trunk(WIN), 2001-04-09-09-trunk(MAC), 2001-04-09-09-trunk(LINUX) When file is read-only, we now correctly return error -215 (READ_ONLY). Marking Verified!
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•