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:
parent
f61ba6fec9
commit
f789dcc80e
@ -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":
|
||||
|
Loading…
Reference in New Issue
Block a user