585ff9062c
Consider an electron application that uses `execFile` to run a script that lives within the application code base: ```coffee child_process = require 'child_process' child_process.execFile __dirname + '/script.sh', (error) -> throw error if error? ``` An application like this will fail when being packaged in an `asar` with an following error: ``` Error: spawn EACCES ``` Electron overrides certain `fs` functions to make them work within an `asar` package. In the case of `execFile`, the file to be executed is extracted from the `asar` package into a temporary file and ran from there. The problem is that during the extraction, the original permissions of the file are lost. We workaround this by: 1. Extending `asar.stat` to return whether a file is executable or not, which is information that's already saved in the `asar` header. 2. Setting execution permissions on the extracted file if the above property holds true. Fixes: https://github.com/atom/electron/issues/3512 |
||
---|---|---|
.. | ||
api | ||
asar | ||
crash_reporter | ||
lib | ||
linux | ||
native_mate_converters | ||
resources/mac | ||
atom_command_line.cc | ||
atom_command_line.h | ||
atom_version.h | ||
chrome_version.h | ||
common_message_generator.cc | ||
common_message_generator.h | ||
draggable_region.cc | ||
draggable_region.h | ||
google_api_key.h | ||
id_weak_map.cc | ||
id_weak_map.h | ||
keyboad_util.cc | ||
keyboad_util.h | ||
node_bindings.cc | ||
node_bindings.h | ||
node_bindings_linux.cc | ||
node_bindings_linux.h | ||
node_bindings_mac.cc | ||
node_bindings_mac.h | ||
node_bindings_win.cc | ||
node_bindings_win.h | ||
node_includes.h | ||
options_switches.cc | ||
options_switches.h | ||
platform_util.h | ||
platform_util_linux.cc | ||
platform_util_mac.mm | ||
platform_util_win.cc |