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) {
|
function performFsJob(job) {
|
||||||
let fname = path.join(storePath, job.filename);
|
let parent = storePath;
|
||||||
if (job.mods) fname = path.join(modsPath, job.filename);
|
|
||||||
|
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) {
|
switch (job.type) {
|
||||||
case "readDir":
|
case "readDir":
|
||||||
|
Loading…
Reference in New Issue
Block a user