Bug 961080: apply umask upon completion of downloads. r=amadini

This commit is contained in:
Zack Weinberg 2014-06-20 19:54:06 -04:00
parent 6f9f35438c
commit 03798e605a

View File

@ -611,6 +611,17 @@ this.DownloadIntegration = {
}
#endif
// Now that the file is completely downloaded, mark it
// accessible by other users on this system, if the user's
// global preferences so indicate. (On Unix, this applies the
// umask. On Windows, currently does nothing.)
// Errors should be reported, but are not fatal.
try {
yield OS.File.setPermissions(aDownload.target.path);
} catch (ex) {
Cu.reportError(ex);
}
gDownloadPlatform.downloadDone(NetUtil.newURI(aDownload.source.url),
new FileUtils.File(aDownload.target.path),
aDownload.contentType,