-
Notifications
You must be signed in to change notification settings - Fork 496
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
Is chmod supposed to work in MSYS2? #2016
Comments
FTR, doesn't work in WSL2:
|
Definitely works as expected on WSL2:
but not at all on MSYS2:
@lazka Do you remember why you've removed the bug label? |
|
The good thing is: we now have an answer in this issue about the status quo. |
I am not sure "why" but I did not find any usefulness of chmod or chown in Windows environment. If the file has shebang it automatically becomes executable. Others may explain the reason. |
The motivation is as follows: The POSIX and NTFS/Windows permission models differ in ways that make it difficult to translate between them correctly AND succintly. The Cygwin folks are definitely doing a good job, but it's not without issues (IIRC f.i. the Windows/Explorer file security dialog still trips over the Cygwin-generated ACLs). The alternative mode (noacl) makes permissions work seamlessly by just letting Windows manage them and only ever reading them. Since the main goal of MSYS2's emulation layer is just to enable native Win32 software, there doesn't seem to be a point in going for the full bidirectional translation. |
FWIW there is a Git for Windows PR to copy mode bits from/to NTFS volumes in a WSL-compatible way, but those bits will definitely be ignored by Cygwin. |
Aren't those NTFS extended attributes be removed when the file is modified? i.e. one of the drawbacks of WSL1. |
They are not removed when the file is modified. However, many Unix programs do not actually modify files: they write new, temporary files, and then force-rename them to the actual file name. And yes, that pattern will lose the extended attributes unless the Unix program is written with POSIX extended attributes in mind. |
@elieux, thanks for the nice summary. The only thing that I wonder about is: – Do anyone ever has asked for the mode support to be bidirectional? IMO folks expecting real change from |
This leads me to the conclusion:
[*] Folks like @angelog0, @GitMensch, maybe @dlmiles from #3695 (comment), and surely me. I see this as an opposing directions of both camps (even as a conflict of interests). In such situations I always try to suggest to look at the @midipix-project. So as not to waste each others time. Attention points about using midipix:
And I invite everyone interested to participate in it (rather than bug the MSYS2 folks:) |
There are some situations though where file permissions become problematic for specific applications - one that comes to mind is |
@SlySven, for me MSYS2 version of SSH client programs work just fine without having to tinker with permission. Then you could use OS-native, pure Win32 ports of these programs. They come with Windows since some w10 build circa 2018 or so: https://woshub.com/connect-to-windows-via-ssh/ My other suggestion remains: use Cygwin. Or even better try using Midipix, although it requires manual cross-compilation + some additional patching related to its' RNG implementation or so for the SSH client programs to work. |
I notice this:
The same steps on WSL(1) work:
The text was updated successfully, but these errors were encountered: