1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Limited performFsJob to parent folder

This commit is contained in:
DJ1TJOO 2021-03-02 14:06:50 +01:00
parent f61ba6fec9
commit f789dcc80e

View File

@ -155,8 +155,19 @@ ipcMain.on("exit-app", (event, flag) => {
});
function performFsJob(job) {
let fname = path.join(storePath, job.filename);
if (job.mods) fname = path.join(modsPath, job.filename);
let parent = storePath;
if (job.mods)
let parent = modsPath;
const fname = path.join(parent, job.filename);
const relative = path.relative(parent, fname);
//If not a child of parent
if(!relative && !relative.startsWith('..') && !path.isAbsolute(relative))
return {
error: "Cannot get above parent folder"
}
switch (job.type) {
case "readDir":