From e6a71d77a18e91eacde74ed6a1f77e667d95cdf1 Mon Sep 17 00:00:00 2001 From: wdlut <97447303+wdlut@users.noreply.github.com> Date: Sun, 3 Mar 2024 21:27:28 +0100 Subject: [PATCH] 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. --- pluginHandler.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pluginHandler.js b/pluginHandler.js index 83138a4c..ceb911c9 100644 --- a/pluginHandler.js +++ b/pluginHandler.js @@ -409,7 +409,8 @@ module.exports.pluginHandler = function (parent) { zipfile.openReadStream(entry, function (err, readStream) { if (err) throw err; readStream.on('end', function () { zipfile.readEntry(); }); - readStream.pipe(obj.fs.createWriteStream(filePath)); + const fileMode = (entry.externalFileAttributes >> 16) & 0x0fff; + readStream.pipe(obj.fs.createWriteStream(filePath, { mode: fileMode } )); }); } }); @@ -535,4 +536,4 @@ module.exports.pluginHandler = function (parent) { } } return obj; -}; \ No newline at end of file +};