Preservation of the executable rights of the files contained in a plugin (#5865)
On file systems that support this, the executable rights of a plug-in's files are retained.
wdlut committed
Mar 3, 2024 at 21:27 UTC
e6a71d77a18e91eacde74ed6a1f77e667d95cdf1
1 file changed
+3
-2
pluginHandler.js
+3
-2
@@ -409,7 +409,8 @@ module.exports.pluginHandler = function (parent) {
409
zipfile.openReadStream(entry, function (err, readStream) {
410
if (err) throw err;
411
readStream.on('end', function () { zipfile.readEntry(); });
412
- readStream.pipe(obj.fs.createWriteStream(filePath));
412
+ const fileMode = (entry.externalFileAttributes >> 16) & 0x0fff;
413
+ readStream.pipe(obj.fs.createWriteStream(filePath, { mode: fileMode } ));
414
});
415
}
416
});
@@ -535,4 +536,4 @@ module.exports.pluginHandler = function (parent) {
536
}
537
}
538
return obj;
538
-};
\ No newline at end of file
539
+};