mate::Dictionary dict(isolate, v8::Object::New(isolate));
dict.Set("size", stats.size);
dict.Set("offset", stats.offset);
- dict.Set("executable", stats.executable);
dict.Set("isFile", stats.is_file);
dict.Set("isDirectory", stats.is_directory);
dict.Set("isLink", stats.is_link);
#include "atom/common/asar/scoped_temporary_file.h"
#include "base/files/file.h"
+#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/pickle.h"
#include "base/json/json_reader.h"
return false;
info->size = static_cast<uint32>(size);
- info->unpacked = false;
if (node->GetBoolean("unpacked", &info->unpacked) && info->unpacked)
return true;
return false;
info->offset += header_size;
- info->executable = false;
node->GetBoolean("executable", &info->executable);
return true;
if (!temp_file->InitFromFile(&file_, info.offset, info.size))
return false;
+#if defined(OS_POSIX)
+ if (info.executable) {
+ // chmod a+x temp_file;
+ base::SetPosixFilePermissions(temp_file->path(), 0755);
+ }
+#endif
+
*out = temp_file->path();
external_files_.set(path, temp_file.Pass());
return true;
class Archive {
public:
struct FileInfo {
- FileInfo() : size(0), offset(0) {}
+ FileInfo() : unpacked(false), executable(false), size(0), offset(0) {}
bool unpacked;
bool executable;
uint32 size;
asar = process.binding 'atom_common_asar'
child_process = require 'child_process'
-fs = require 'fs'
path = require 'path'
util = require 'util'
newPath = archive.copyFileOut filePath
notFoundError asarPath, filePath unless newPath
- stat = archive.stat filePath
-
- if stat.executable
- fs.chmodSync(newPath, 0o755)
-
arguments[arg] = newPath
old.apply this, arguments
newPath = archive.copyFileOut filePath
return notFoundError asarPath, filePath, callback unless newPath
- stat = archive.stat filePath
-
- if stat.executable
- fs.chmodSync(newPath, 0o755)
-
arguments[arg] = newPath
old.apply this, arguments