{"push_id":881315039,"size":1,"distinct_size":1,"ref":"refs/heads/jviotti/fix/3512/execFile-override-exec-permissions","head":"e8ce7627c44012bd4c6a4a15eb6fc716660e911e","before":"a8edacb03211dc5fb144529fd7f527ffee8838f8","commits":[{"sha":"e8ce7627c44012bd4c6a4a15eb6fc716660e911e","author":{"email":"0ea8f952c1af5f31bfbcb64030ed3483c649d788@gmail.com","name":"Juan Cruz Viotti"},"message":":bug: Fix missing execution permission bit in execFile override\n\nConsider an electron application that uses `execFile` to run a script\nthat lives within the application code base:\n\n```coffee\nchild_process = require 'child_process'\nchild_process.execFile __dirname + '/script.sh', (error) ->\n  throw error if error?\n```\n\nAn application like this will fail when being packaged in an `asar` with\nan following error:\n\n```\nError: spawn EACCES\n```\n\nElectron overrides certain `fs` functions to make them work within an\n`asar` package. In the case of `execFile`, the file to be executed is\nextracted from the `asar` package into a temporary file and ran from\nthere.\n\nThe problem is that during the extraction, the original permissions of\nthe file are lost.\n\nWe workaround this by:\n\n1. Extending `asar.stat` to return whether a file is executable or not,\n  which is information that's already saved in the `asar` header.\n\n2. Setting execution permissions on the extracted file if the above\n  property holds true.\n\nFixes: https://github.com/atom/electron/issues/3512","distinct":true,"url":"https://api.github.com/repos/jviotti/electron/commits/e8ce7627c44012bd4c6a4a15eb6fc716660e911e"}]}