msys2-runtime icon indicating copy to clipboard operation
msys2-runtime copied to clipboard

:lady_beetle: MSYS MINGW64 doesn't respect chmod and reports different file permissions than Cygwin

Open eabase opened this issue 4 months ago • 4 comments

Using:

# MSYS
Bash Version :  5.2.37(2)-release
MSYS Version :  MINGW64_NT-10.0-26100 version 3.6.4-23a25d49.x86_64 (runneradmin@runnervm51nrn) (gcc version 15.1.0 (GCC) ) 2025-07-16 16:15 UTC

# Cygwin
Bash Version :  5.2.21(1)-release
CygW Version :  CYGWIN_NT-10.0-26100 version 3.6.4-1.x86_64 (runneradmin@runnervm51nrn) (gcc version 12.5.0 (GCC) ) 2025-07-15 07:55 UTC

My editor refused to recognize some files, even though they had the same extension. It turned out that it was picking up on the file permissions.

# MSYS / MINGW64
# ls -al
-rw-r--r-- 1 xxxx Nobody  2316 Aug 20 21:54 G3_CMakeLists.txt
-rwxr-xr-x 1 xxxx Nobody  6032 Aug 20 23:40 G4_CMakeLists.txt

So I tried to change permission using: chmod 755 G3_CMakeLists.txt but nothing happened.

Then I checked the same in Cygwin:

# Cygwin
# ls -al
-rwxrwx---+ 1 xxxx Nobody  2316 Aug 20 21:54 G3_CMakeLists.txt
-rwxrwx---+ 1 xxxx Nobody  6032 Aug 20 23:40 G4_CMakeLists.txt

WTF is going on?

eabase avatar Aug 22 '25 10:08 eabase

MSYS2 mounts everything with noacl, while cygwin doesn't. executable bit is detected via heuristics then, like when there is a shebang in the file for example.

lazka avatar Aug 22 '25 10:08 lazka

@lazka

MSYS2 mounts everything with noacl, ...

Wow, ok, interesting. But how does that work? Where can I get more info on this?

This brings up many questions:

  • Is there any workarounds to implement and make chmod work in MSYS?
  • So then, what acl become the effective default for new files and directories created under MSYS?
  • What is the reason behind this?
  • How can I check effective ACL's from MSYS?

Finally, is this a bug or by design?

eabase avatar Aug 22 '25 21:08 eabase

MSYS2 mounts everything with noacl, ...

Wow, ok, interesting. But how does that work? Where can I get more info on this?

https://cygwin.com/cygwin-ug-net/mount.html

This brings up many questions:

  • Is there any workarounds to implement and make chmod work in MSYS?

edit /etc/fstab and remove noacl options.

jeremyd2019 avatar Aug 22 '25 21:08 jeremyd2019

Ok, this was useful:

  • https://cygwin.com/cygwin-ug-net/using-cygwinenv.html

Still not sure why acl is turned off by default in MSYS, and if turning it back on, is gonna create issues when updating with pacman.

eabase avatar Aug 22 '25 23:08 eabase