From 0e896fe9fedcc5f82524e746e2830824fe7c0300 Mon Sep 17 00:00:00 2001 From: wdlut <97447303+wdlut@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:33:13 +0100 Subject: [PATCH] Bugfix for plugin filemode #5865 (#5897) Some files were created with file rights of 0o000. It was not even possible to read them. --- pluginHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pluginHandler.js b/pluginHandler.js index d1d324ee..6843c803 100644 --- a/pluginHandler.js +++ b/pluginHandler.js @@ -412,7 +412,8 @@ module.exports.pluginHandler = function (parent) { if (process.platform == 'win32') { readStream.pipe(obj.fs.createWriteStream(filePath)); } else { - const fileMode = (entry.externalFileAttributes >> 16) & 0x0fff; + var fileMode = (entry.externalFileAttributes >> 16) & 0x0fff; + if( fileMode <= 0 ) fileMode = 0o644; readStream.pipe(obj.fs.createWriteStream(filePath, { mode: fileMode })); } });