fox-it / dissect.target

The Dissect module tying all other Dissect modules together. It provides a programming API and command line tools which allow easy access to various data sources inside disk images or file collections (a.k.a. targets).
GNU Affero General Public License v3.0
44 stars 44 forks source link

Support Unix-y filesytems on Windows target #610

Open DissectBot opened 6 months ago

DissectBot commented 6 months ago

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.