-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling case sensitive paths in registry sometimes breaks flinux #58
Comments
I once tried to use relative paths but found an issue. Say your |
We can preprocess all paths before doing the actual file operations (resolve .. and .) and going "above" root can be handled there. On another note, we should also be able to reuse most parts of winfs to mount out-of-root paths, to be able to access the rest of the windows filesystem. |
No, preprocessing Take this example, let's say Back to this issue, isn't there any reliable way to get case correct path of current directory? (maybe via |
On a related note, is the |
Oh and back to the relative directory problem, you said
I don't see why this wouldn't work with relative dir handles too. |
Ok. Go ahead with the relative paths for handling current directory. We just need to find a reliable way to open the handle to current directory. I think something like Per my knowledge, |
In my test I just used Regarding the relative path stuff, if you think it wouldn't make anything better or make things worse, I don't want to force anything, just having ideas. |
I was thinking that if Just now I realized we can also apply Actually I cannot decide which approach is better at this point. To make a conclusion we need to also consider some unimplemented functions like For now maybe using path concatenation is more reasonable since it requires very small modification to the code to fix this issue. |
I discovered that by default, even if you use
NtCreateFile
and friends withoutOBJ_CASE_INSENSITIVE
, file handling is case insensitive in Windows. To enable case sensitivity, you have to setHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Kernel\obcaseinsensitive
to0
in the registry (and restart Windows).Now, when I did this, flinux wouldn't start when ran from Total Commander, but ran fine from a cmd opened directly from windows. The cause is that
GetCurrentDirectoryW
doesn't always give the real actual name of the current directory (I guess it depends on how it was set).For example, ran from Total commander, the path looks like
d:\Prog\flinux-env
, but when ran from a cmd opened directly from windows, it looks likeD:\Prog\flinux-env
. Notice the drive letter difference. The problem is, the drive's real name is 'D:' with a capital D, so now that file access is case sensitive, flinux can't open anything in the Total Commander case.Idea for a fix:
In winfs, don't always just append the root path to the file being acted on. Rather, on initialization first find the real path of the root/current directory somehow (maybe by opening it by CreateFile, then using
GetFinalPathNameByHandle
) then opening it with NtCreateFile, and storing the handle. Then later on, when opening a file, set this handle in theObjectAttributes
RootDirectory
parameter ofNtCreateFile
, and use a relative path.The text was updated successfully, but these errors were encountered: