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.
This commit is contained in:
wdlut 2024-03-03 21:27:28 +01:00 committed by GitHub
parent 9e9cd821bf
commit e6a71d77a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

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