Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#564 closed defect (fixed)

GetRealPath doesn't

Reported by: Philip Taylor Owned by: Jan Wassenberg
Priority: Should Have Milestone: Alpha 2
Component: Core engine Keywords:
Cc: Patch:

Description

IVFS::GetRealPath claims to "retrieve the real (POSIX) pathname underlying a VFS file", but it seems to work incorrectly with mods. In particular, it always returns a path like .../data/mods/public/... (or always internal if that mod is loaded), even when the VFS file comes from a different mod.

CXeromyces::GetXMBPath tries to get the mod name from this, which doesn't work since it always returns public (or always internal).

Getting the mod name seems like useful functionality - by separating caches per mod, we can avoid one mod maliciously polluting the cache with a file with the same size/timestamp as another mod's but with different content (which would probably cause OOS errors after the first mod is disabled).

I don't know what GetRealPath should return if the file is in an archive. (It probably doesn't matter here, since archives ought to already contain cached files and we won't need to dynamically generate them.)

Change History (3)

comment:1 by Jan Wassenberg, 14 years ago

Resolution: fixed
Status: newclosed

(In [8082]) fix VFS real path retrieval for files mounted from multiple directories (e.g. mods) closes #564 GetRealPath was too simplistic and just asked the directory *most recently mounted* into the file's VFS directory for its path. the correct solution is to ask the file's loader for its path. the archiver IFileLoader new returns the archive's pathname as the real path. also simplified VfsFile's interface.

comment:2 by (none), 14 years ago

Milestone: Unclassified

Milestone Unclassified deleted

comment:3 by historic_bruno, 12 years ago

Milestone: Alpha 2
Note: See TracTickets for help on using tickets.