Closed rfuzzo closed 1 year ago
Thinking about the checks a bit more. One simple alternative to the rather complicated path checking in the PR could also be just to get the lexically_relative path between the filePath and the currentDir if uvfs is detected - and for safety we could check the input lua path for "..//".
Eh, checking for .. is sketchy, they may be valid cases (like when mod from some of its subfolder does something with parent)
Dont think that is a good solution.
And on top, it may appear in the middle of the path potentially and you could still escape
sth/../../yey
I think this looks good apart from the few commented out stuff at least on first glance... I'd rather have a more proper look in like an hour though cause cant discern changes to the GetLuaPath as you moved + changed it in same commit.
The problem
When launching the game through Mod Organizer 2, CET mods don't work That is because
Any mod that creates files at runtime (that is ALL CET mods since the sandbox db gets created at runtime) will fail since the "overwrite" directory escapes the mod sandbox.
This PR
This PR does two things:
usvfs_x64.dll
)Since
GetLuaPath
does more checks now, I needed to move it out of utils into sandbox. This also incurred pulling the sandbox into more lambdas.Pros and Cons
Pros:
Cons: