Commit graph

42 commits

Author SHA1 Message Date
Cheng Zhao
e3ec1fe8ab Add process.noAsar to turn off asar support 2015-12-01 13:09:37 +08:00
Cheng Zhao
cfdcfcbd80 Add executable permission in CopyFileOut 2015-11-27 22:06:37 +08:00
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
Cheng Zhao
784d2633a9 Make child_process.execFileSync support asar 2015-11-20 10:33:57 +08:00
Antonio Scandurra
9c69877421 Allow v8 to optimize fs.readFileSync 2015-10-30 10:30:27 +01:00
Prince J Wesley
810af2f95d 🐛 Honor fs.readFileSync contract for empty packed asar file 2015-10-19 08:43:50 +05:30
Indrek Ardel
c626ee6e92 Fix a typo 2015-09-19 21:17:23 +03:00
Rich Hong
f51103f44a Update internalModuleReadFile to support unpacked asar files
Add tests for reading unpacked files using both fs.readFileSync and
internalModuleReadFile
2015-06-22 19:38:47 -04:00
Cheng Zhao
db8ffe1dc7 Handle ".." in asar path, fix #1982 2015-06-17 15:52:49 +08:00
Cheng Zhao
605722c397 Make asar work with internalModuleReadFile and internalModuleStat 2015-06-10 16:18:55 +08:00
Kirk Ouimet
75448ad7ed Guarding against polluted Object.prototypes 2015-06-07 23:59:49 -07:00
Cheng Zhao
d9c769fa69 Reuse archive's fd in Node asar API 2015-05-11 11:10:50 +08:00
deepak1556
da648511b3 asar: make fs async methods create errors asynchronously 2015-04-25 10:08:02 +05:30
Cheng Zhao
1479f73612 Simplify #1261 2015-03-21 19:20:52 +08:00
Cheng Zhao
5e8c478b2c Merge pull request #1261 from deepak1556/asar_lib_patch
fs.read empty files from asar archive
2015-03-21 19:17:49 +08:00
deepak1556
fdc10e4e5f Allow reading empty file from asar archive 2015-03-21 14:56:03 +05:30
Cheng Zhao
b5a8cfb704 Recognize asar archive with unpacked files 2015-03-20 20:34:58 +08:00
Cheng Zhao
1df033dce8 No need to override child_process.fork
We already support asar in Node mode.
2015-03-20 19:04:11 +08:00
Cheng Zhao
45e2dd2ab5 Init asar support without external .js files 2015-02-04 10:45:17 -08:00
Cheng Zhao
0a393eaa1c Enable wrap arbitrary fs object 2015-02-02 13:35:32 -08:00
Subash Pathak
9f8a5a7af3 Optimize fs.stat 2014-10-02 23:35:37 +05:45
Subash Pathak
dde8e47add Time Shim 2014-10-01 22:24:51 +05:45
Subash Pathak
0040f07097 Added Stat Time 2014-10-01 22:01:57 +05:45
Cheng Zhao
915c1b19d3 asar: Fix fs.realpath on package's root 2014-09-30 15:09:50 +08:00
Cheng Zhao
b87dfb964c asar: Add support in fs.realpath 2014-09-30 14:57:49 +08:00
Cheng Zhao
885ac53a48 asar: Add support in fs.realpathSync 2014-09-30 14:53:58 +08:00
Cheng Zhao
e24976c59f Fix overriding async node API 2014-09-29 16:28:51 +08:00
Cheng Zhao
35e867820e Make sure fs.stat and fs.lstat are async 2014-09-29 14:59:44 +08:00
Cheng Zhao
a757c62da5 Use "null" instead of "undefined" as no error 2014-09-29 14:57:10 +08:00
Cheng Zhao
4d01aa2772 Fix shifting args in fs.readFile 2014-09-28 23:36:12 +08:00
Cheng Zhao
150739e19e Fix calling fs.open in fs.readFile wrapper 2014-09-28 22:45:29 +08:00
Cheng Zhao
38f83cacf9 Make some APIs work with archive.copyFileOut API. 2014-09-25 23:25:17 +08:00
Cheng Zhao
8acf96d268 Make spliting paths faster. 2014-09-25 22:18:40 +08:00
Cheng Zhao
390b804ca0 Make process.dlopen work for asar packages. 2014-09-25 21:49:28 +08:00
Cheng Zhao
05317ad81e Clean cached asar archives when quitting. 2014-09-25 21:49:01 +08:00
Cheng Zhao
dbbfef38b1 Cache asar archives on JavaScript side. 2014-09-25 20:48:32 +08:00
Cheng Zhao
e0c469183d Make sure fs.readdir calls its callback asynchronously. 2014-09-24 19:10:37 +08:00
Cheng Zhao
4d2e4ed573 Fill the stats object as much as we can. 2014-09-24 19:10:13 +08:00
Cheng Zhao
0cab034dab Make fs.readdir support asar package. 2014-09-24 18:44:00 +08:00
Cheng Zhao
9f9d209e3d Make options of fs.readFile work. 2014-09-24 16:24:22 +08:00
Cheng Zhao
8740147aa2 Make fs.readFile support asar package 2014-09-24 15:38:07 +08:00
Cheng Zhao
9b755620d3 Make fs.stat support asar package 2014-09-24 15:38:02 +08:00