dissect.target icon indicating copy to clipboard operation
dissect.target copied to clipboard

Support Unix-y filesytems on Windows target

Open DissectBot opened this issue 1 year ago • 0 comments

Currently when mounting a Unix-y filesystem (say extfs, ffs etc.) on a windows target there are certain filenames which will lead to issues.

Windows targets have "\" as an alternate path separator and are case {}in{}sensitive. This means that a Unix-y fs which has the files FOO and foo the one reached when doing a .get("FOO") depends on the first one found and also on the exact class the .get() is called on.

A similar thing happens for files with a "\" in the filename, which is allowed on Unix-y filesystems but not on Windows filesystems.

As case-sensitiveness is currently not properly enforced everywhere the results may be even more random (see DIS-1679).

To fix this filesystems that do not specify "\" as an alternative path separator should be "overlayed" with a shim that translates these filenames when mounted on a Windows target.

This is probably best implemented in the filesystem.Filesystem class on change of the alt-separator. This change is what happens when a Windows target is initialized. It forces the alt-separators of al the fs-es to be "\". This should probably be extended to the mount command of RootFilesystem so fs-es mounted later on will get the same treatment.

The translation done is best modeled on similar translations in the wild. So figure out how this is currently handled in e.g. the extfs driver for Windows.

DissectBot avatar Mar 18 '24 14:03 DissectBot