Bug 1230857 - Make GMPInstallManager enforce sensible permissions on GMP files at install time. r=spohl
This ensures that GMP packages with bad permissions will still be usable. For
example, a GMP without execute/read permissions in its zip won't work without
this.
--- a/toolkit/modules/GMPInstallManager.jsm
+++ b/toolkit/modules/GMPInstallManager.jsm
@@ -416,16 +416,19 @@ GMPExtractor.prototype = {
outFile.appendRelativePath(entry);
// Make sure the directory hierarchy exists
if(!outFile.parent.exists()) {
outFile.parent.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt("0755", 8));
}
zipReader.extract(entry, outFile);
extractedPaths.push(outFile.path);
+ // Ensure files are writable and executable. Otherwise we may be unable to
+ // execute or uninstall them.
+ outFile.permissions |= parseInt("0700", 8);
log.info(entry + " was successfully extracted to: " +
outFile.path);
});
zipReader.close();
if (!GMPInstallManager.overrideLeaveDownloadedZip) {
zipFile.remove(false);
}