Closed Bug 1030029 Opened 11 years ago Closed 9 years ago

Some zipped plugins (e.g. GitHub) fail to install because nsIZipReader extracts files read-only

Categories

(Other Applications :: ChatZilla, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hunboy, Assigned: bugzilla-mozilla-20000923)

References

Details

(Keywords: regression, Whiteboard: [cz-0.9.93])

Attachments

(1 file)

During installing cz-plugin-***.zip it fails with this error message: An error occurred extracting the compressed source: [Exception... "Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsILocalFile.remove]" nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS frame :: chrome://chatzilla/content/static.js :: cli_installPlugin :: line 3391" data: no]
mozilla central 2012.12.04 last good 2012.12.05 first fail http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=5c6b71348e20&tochange=0947e291578a the plausible blocker bug is Bug 369108
Depends on: 369108
Keywords: regression
when I comment out the initJSFile.remove(false); line, it works. the install-plugin.temp file is read only. This is the problem.
CC-ed Brian R. Bondy The nsIZipReader extracts the files in readonly mode permanently based on Bug 369108, so unzips the all of plugin files as readonly. I've checked the zipReader's inteface and no way to set up filemode at zipReader.extract() void extract(in AUTF8String zipEntry, in nsIFile outFile) this is a permanent problem for update/delete plugin as well.
So I think we should either not set the permissions mode when extracting to avoid getting the read only in the first place, or we could update nsIFile's implementation on Windows to remove the read only bit before removing if it fails.
Flags: needinfo?(gijskruitbosch+bugs)
It's not clear where the original report here was getting the zip, but I know GitHub's zips are a problem: [22:14:20] [INFO] Downloading plugin from 'https://github.com/twpol/cz-plugin-network-trace/archive/master.zip'… [22:14:21] [INFO] Installing from 'C:\Users\James\AppData\Roaming\ChatZilla\Profiles\0n2xrybw.default\chatzilla\plugin-install.temp.zip' to 'E:\Documents\Coding\ChatZilla\Scripts'… [ERROR] An error occurred extracting the compressed source: [Exception... "Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsILocalFile.remove]" nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS frame :: chrome://chatzilla/content/static.js :: cli_installPlugin :: line 3329" data: no]
Summary: install plugin is broken with zipped plugin → Some zipped plugins (e.g. GitHub) fail to install because nsIZipReader extracts files read-only
Assignee: rginda → bugzilla-mozilla-20000923
Status: NEW → ASSIGNED
Attachment #8716805 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 8716805 [details] [diff] [review] Set permissions to 0666 for every extracted file r=me assuming this was tested on Windows, and throws just as or less often as/than the .remove() call (ie what if we don't have the rights to set the permissions to 0666 ? Presumably the setter will throw, but then, the .remove() call would also have thrown...)
Flags: needinfo?(gijskruitbosch+bugs)
Attachment #8716805 - Flags: review?(gijskruitbosch+bugs) → review+
This was tested on Windows - the SetPermission implementation looks for any-read and any-write, of which only any-write is implemented (as setting and unsetting the read-only flag). Other platforms should work per Unix. http://hg.mozilla.org/chatzilla/file/ecf32181bbab
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.93]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: