fix(BrowserFetcher): ensure executable has proper permissions (#2342)

This patch ensures Chromium executable has permissions to be executed
by non-owner users.

Fixes #2283.
This commit is contained in:
Andrey Lushnikov
2018-04-10 14:11:59 -07:00
committed by GitHub
parent beea6f9c82
commit 5089d2ec2e
2 changed files with 8 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ const downloadURLs = {
const readdirAsync = helper.promisify(fs.readdir.bind(fs));
const mkdirAsync = helper.promisify(fs.mkdir.bind(fs));
const unlinkAsync = helper.promisify(fs.unlink.bind(fs));
const chmodAsync = helper.promisify(fs.chmod.bind(fs));
function existsAsync(filePath) {
let fulfill = null;
@@ -115,7 +116,10 @@ class BrowserFetcher {
if (await existsAsync(zipPath))
await unlinkAsync(zipPath);
}
return this.revisionInfo(revision);
const revisionInfo = this.revisionInfo(revision);
if (revisionInfo)
await chmodAsync(revisionInfo.executablePath, 0o755);
return revisionInfo;
}
/**