electron/atom/common/api
Juan Cruz Viotti 585ff9062c 🐛 Fix missing execution permission bit in execFile override
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
2015-11-26 23:30:23 -04:00
..
lib Use the new style remote module in Electron 2015-11-13 22:22:25 +08:00
api_messages.h webcontents: notify guests of embedders' zoom level change 2015-10-08 10:38:22 +05:30
atom_api_asar.cc 🐛 Fix missing execution permission bit in execFile override 2015-11-26 23:30:23 -04:00
atom_api_clipboard.cc clipboard: api to write multiple formats to same writer 2015-07-10 09:20:52 +05:30
atom_api_crash_reporter.cc Simplify and polish the code. 2015-06-04 15:53:37 +08:00
atom_api_id_weak_map.cc Clean up the code handling renderer callback 2015-10-31 15:00:06 +08:00
atom_api_id_weak_map.h Clean up the code handling renderer callback 2015-10-31 15:00:06 +08:00
atom_api_native_image.cc Replace "Url" in API names with "URL" 2015-11-13 16:03:40 +08:00
atom_api_native_image.h Add NativeImage.IsTemplateImage method 2015-07-26 21:58:48 -07:00
atom_api_native_image_mac.mm Minor style fix for #2352 2015-07-29 11:48:40 +08:00
atom_api_shell.cc No longer needs to define node_includes.h at last 2015-09-07 16:41:49 +08:00
atom_api_v8_util.cc add line and column values to callback id 2015-10-29 21:21:30 +05:30
atom_bindings.cc Do not turn off deprecation notice by default 2015-11-09 21:19:16 +08:00
atom_bindings.h Use Local instead of Handle 2015-05-22 19:11:22 +08:00
event_emitter_caller.cc No longer needs to define node_includes.h at last 2015-09-07 16:41:49 +08:00
event_emitter_caller.h Use WebScopedRunV8Script in converted C++ functions 2015-08-07 19:37:17 +08:00
locker.cc Use WebScopedRunV8Script in converted C++ functions 2015-08-07 19:37:17 +08:00
locker.h Use WebScopedRunV8Script in converted C++ functions 2015-08-07 19:37:17 +08:00
object_life_monitor.cc Use V8's new SetWeak method 2015-08-27 16:41:51 +08:00
object_life_monitor.h Use V8's new SetWeak method 2015-08-27 16:41:51 +08:00