Bugfix for plugin filemode #5865 (#5897)
Some files were created with file rights of 0o000. It was not even possible to read them.
wdlut committed
Mar 5, 2024 at 11:33 UTC
0e896fe9fedcc5f82524e746e2830824fe7c0300
1 file changed
+2
-1
pluginHandler.js
+2
-1
@@ -412,7 +412,8 @@ module.exports.pluginHandler = function (parent) {
412
if (process.platform == 'win32') {
413
readStream.pipe(obj.fs.createWriteStream(filePath));
414
} else {
415
- const fileMode = (entry.externalFileAttributes >> 16) & 0x0fff;
415
+ var fileMode = (entry.externalFileAttributes >> 16) & 0x0fff;
416
+ if( fileMode <= 0 ) fileMode = 0o644;
417
readStream.pipe(obj.fs.createWriteStream(filePath, { mode: fileMode }));
418
}
419
});