On 12/23/22 17:09, Krzysztof Żelechowski wrote:
chmod a-r a.txt && stat a.txt

Expected: chmod: unsupported permissions
Got: -r--r--r--
This is wrong because the command chmod had failed to set the permissions

The chmod command is doing the right thing; the problem lies elsewhere. Run "strace chmod a-r a.txt". You should see something like "fchmodat(AT_FDCWD, "a.txt", 0200) = 0" which means chmod told the kernel to change a.txt's permissions to -w------- and the kernel responded that it did so successfully.

The problem here is a squirrelly filesystem. Run "man ntfs-3g" and look for "Access Handling and Security".




Reply via email to