Bugfix for plugin filemode #5865 (#5897)

Some files were created with file rights of 0o000. It was not even possible to read them.
This commit is contained in:
wdlut 2024-03-05 11:33:13 +01:00 committed by GitHub
parent 0a59f9dbae
commit 0e896fe9fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 }));
}
});