-
Notifications
You must be signed in to change notification settings - Fork 860
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
case sensitivity for NTFS handled incorrectly in bash.exe #2081
Comments
I'm not sure what you are showing us here. You shouldn't be able to create two different files or directories with the same name. C:\Users\Dan>mkdir foo && mkdir Foo |
@raymod2 -- what he's showing you is that NTFS's expected behavior is more complicated than you think it is :-) For what it's worth, I appreciate that Windows is adhering to correct Linux semantics here. Having paths that are valid but that don't show up in |
bash supports case sensitivity on DrvFs except Windows's root directory. |
LOL, I am seeing a pattern here. Whenever someone suggests a feature for WSL that deviates from a pure Linux environment there are 3 or 4 people who jump on it and claim it will cause a rift in the space/time continuum. Do you 3 or 4 people realize that this is a Microsoft WINDOWS product??? I am truly astonished that you guys don't just run Linux. |
@raymod2 -- my apologies. It's a fair criticism. I don't mean to silence differing opinions; I think it's important that the WSL team hear that there's interest in case-insensitivity and other similar features. I hope they have heard your commentary. That said: The top of the main WSL documentation page says that one of the core objectives of WSL is to run, to quote that page, "UNMODIFIED" Linux binaries, including the bash shell itself. That ain't me; no one on this thread put that text there, it's the official Microsoft line as far as I know. If you're going to advocate (as here) that a project should do something that goes against against the big bold text at the top of its main page ... I mean, honestly that's kind of awesome; WSL's Windows interop isn't going to get any better without someone being bold and breaking traditional Linux semantics somewhere. But it's not going to be an easy argument to make. And us in the peanut gallery don't have much to do with that :-) |
People in the peanut gallery are both empowered and encouraged to do just that. The peanut gallery has everything to do with it. If someone (your words) wants to add (for example) case insensitive filename completion to |
Ah, references... "that" -> "not going to be an easy argument" |
Didn't read the whole thread, but microsoft disabled this feature in the root of /mnt/c for security reasons . You can have files differing by a capital letter in any other directory. |
@therealkenc it's also an option in zsh's settings fwiw. |
What is this witchcraft?! Guessing you didn't create this through WSL haha |
@fpqc: You can't have two file system entries with the same name in any directory. Have you tried it? |
Here is an article that clarifies a few things regarding case sensitivity on Windows: https://support.microsoft.com/en-us/help/100625/filenames-are-case-sensitive-on-ntfs-volumes What I am requesting in this ticket is for Bash on Windows to use the second mode of operation for NTFS mounts (to be case preserving but case insensitive). |
@raymod2 I think I am understanding what you mean now: You're asking for DrvFS ntfs mounts to actually enforce case preserving + insensitivity like fat32. The reason we don't have that right now, I think, is that direct drvfs filesystem access is the only interop method we have right now. I'm hoping that in the future, there will be a Windows-side driver and a Linux-side server that mounts lxfs as like nfs on Windows and serves it as nfs from WSL, or something like that. |
So... User Voice. The feature request reads something like: "The WSL
...is that there would be no use case for such behavior. In particular it would not give you case insensitive tab completion, which is the ask. Because whether And, unsurprisingly, is an option in
FTFY |
@therealkenc: Are you trolling? What is this nonsense about open() returning EPERM? Your "set completion-ignore-case on" doesn't work in Bash on Windows. Have you tried it? Also, it won't fix the example I gave in my first post: mkdir /mnt/c/Foo && cd /mnt/c/foo |
@raymod2 - @therealkenc's suggestion works for me (I pressed tab after inputting "ex"):
|
@therealkenc I think he means use win32 semantics in the drvfs driver for NTFS (another option would be to add mount options). It does make sense, even if it might be undesirable. There are drivers that do this or can do it with options, in particular ntfs-3g has an option |
@benhillis: Ah, I was trying to run the command directly in the bash shell (or in my .bashrc) and it wasn't doing anything. Putting it in ~/.inputrc works. This is an improvement for usability but doesn't resolve the other issues.
|
Yes please put up a User Voice for that as soon as possible. The quote I gave you is the technical change; you want open(2) to fail with |
I am somewhat ambivalent on this, but I believe I lean "against". ARGUING FOR
So an argument could be made that since DrvFs is different anyway, it might as well be case-insensitive to play nice with Win32. ARGUING AGAINST
The first reason above (compatibility) is what makes me lean "against" currently.
If I have followed the discussion correctly the correct error return should be |
/thread |
I am still hoping for a User Voice entry. Because of the pure awesome. @billziss-gh - Microsoft recently added |
@therealkenc: I think it's time you stepped away from this topic. Your arrogance and sarcasm are not contributing to the discussion. |
@therealkenc wrote:
Wow, thanks. I missed this originally, but now found a link to the NT Insider which has a good discussion. |
Yeah that is where I read about it. There is also this github repo, which you probably saw if you did the same google search as me. I have still been looking at a client SMB solution on and off, FWIW. I might show up over at winfsp if it ever goes anywhere. |
@therealkenc neat! Do you think that filedisposition stuff is related to the work that the WSL team is doing with the ntfs team for better performance and support? |
Better "support", yes that's the gist. Better performance is a slightly different dimension. Russ did a really good post back in August here explaining the challenges. It's an analogous (but unrelated) situation with assumptions Linux-first apps make about the memory manager. As you know the devs are working furiously on all of this, but they are also in the unenviable position of having to weigh "git works but could be faster" against the 1363 users who want CUDA and the 906 users who want |
@therealkenc wrote:
Feel free to drop by any time. From the NT Insider:
[Disclaimer: what I say below may be based on a complete misunderstanding of how I am not convinced that this behavior would do anything magical to get things to work better re: compatibility with The normal delete protocol on Windows involves sending the IRP messages Under the [I am also not sure how this is better than the old trick of renaming the file to a new directory / file and then deleting that file.] The other problem with In any case this is largely off topic. I am happy to continue this discussion elsewhere. |
@raymod2 - Thanks for your post and starting a discussion for a requirement. We appreciate it. I haven't read the full post, but what it appears is that you are asking to have some kind of Windows semantics applied to DrvFs files. I can understand the ask. If that is something you care about, I would really recommend that you open a user voice ticket and see how others also feel about it. As others have noted, and as you understand, this ask goes beyond We do appreciate any and all feedback. So, please keep it coming. |
@sunilmut Just in case you didn't see my post up the thread, given how many posts there are, this does have precedent as a pair of mount options in the I do agree however that this isn't the most important ask at this time. |
@fpqc - agreed, a mount option would be a good way to add this. |
@sunilmut: As far as compatibility is concerned, we don't want users to corrupt their NTFS file systems because of something they do in Bash on Windows. |
@fpqc - Thanks for the suggestion. I think that's a neat way of going about this. Adding @SvenGroot as FYI. @raymod2 - Yes, I think we understand the ramifications. That's one of the reasons it is disabled on system folders such c: etc. We haven't had a lot of people complain about corruption yet. So, at this point, it's not very high on the list. We understand the ask though. |
@sunilmut By the way, offtopic, but supporting some of the other simple ntfs-3g mount options like |
Marking as a feature, the idea for DrvFs mount options to disable case sensitivity or set file owner is a good suggestion. |
DrvFs should honor "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\ dword:ObCaseInsensitive". |
I agree, especially as the the corresponding GPO documentation talks about non-win32-subsystems. (By corresponding I mean, that the linked GPO sets the mentioned registry key.) It explicitly states: "Set this policy to Enabled. All subsystems will be forced to observe case insensitivity." That is clearly not true here, so either the documentation is wrong (or at least misleading) or this is a bug. @benhillis add "bug" label? Note: I still think "case sensitiv" (=current behaviour) is the best default option for DrvFs, but that doesn't change the fact that WSL ignores a (security-)GPO. |
I have run into this issue in a context that I believe illustrates that the correct behavior is not a concession to Windows, but a requirement for any mounted case-ignoring filesystem (e.g., NTFS). I have a linux process that passes a request to a windows process to create a file. The windows process creates the requested file, but in all UPPERCASE letters, so when the linux process tests to see if the requested file was actually created, the linux libraries incorrectly report that the file does not exist, when (in fact) it does. |
Thanks for the info! |
NTFS accepts both uppercase and lowercase characters (and preserves them) for file system entries. However, this is only a cosmetic feature. You cannot have two file system entries in the same directory that differ only in case (ie. 'Foo' and 'foo'). Therefore, when specifying an existing filename or directory, the case is ignored. For example, the following works fine in cmd.exe:
mkdir Foo
cd foo
In bash.exe, however, the following fails:
mkdir /mnt/c/Foo
cd /mnt/c/foo
Also TAB completion fails if you don't use the correct case for each character in a partial filename. This is expected behavior when working with native Linux filesystems. However, it is not expected behavior when using an NTFS mount. This significantly impacts usability for developers working at the command line.
The text was updated successfully, but these errors were encountered: