Files created in Cygwin have corrupt Windows security settings

On one Windows 10 PC, when I create a file from a Cygwin bash shell, the Windows security settings for the file are corrupted.

So, for example, if I type echo test > test.txt, when I bring up the “Properties” → “Security” tab in Windows, I get the following error message: "The permissions on test.txt are incorrectly ordered, which may cause some entries to be ineffective", and (among other issues) I see in the “Group or user names” list box "NULL SID". And when I click on the “Advanced” button, I see several group entries with the "Deny" type. This seems to happen no matter how I create a file. I have tried vi and bzip2 and have the same issue.

This is a local NTFS hard drive.  The folder permissions are correct and I am a local admin on the PC.

I have another Windows 10 PC with Cygwin, running the same bash script, and it works fine.

1

1 Answer

There is a long explanation of the complex mapping of Posix permissions using Windows ACE

Almost at the end in File permissions

Unfortunately the security tab in the file properties dialog of the Windows Explorer insists to rearrange the order of the ACEs to canonical order before you can read them. Thank God, the sort order remains unchanged if one presses the Cancel button. But don't even think of pressing OK...

So the behaviour it is not a mistake, it is by design and just the Windows Explorer has it is own view that does not match the rest of Windows system.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like