Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes "The permissions on <folder> are incorrectly ordered"?

Tags:

windows

dacl

While debugging a particularly troublesome error involving SQLite and IIS, we encountered a permissions problem when accessing the App_Data properties

The permissions on App_Data are incorrectly ordered, which may cause some entries to be ineffective.

Here's a screenshot as well:

enter image description here

My question isn't what incorrect ordering is, I think How do you programmatically fix a non-canonical ACL? already gives a good intro into the problem.

What I want to know is what types of ordering are incorrect? For example, if we put Full Control for Everyone, should that precede or follow some other permission? Are there any examples of incorrect ordering that trigger the error? We clicked Reorder so we no longer can reproduce the error on our machine.

like image 557
sashoalm Avatar asked Nov 27 '17 08:11

sashoalm


People also ask

How do I fix folder permissions?

Right-click the file or folder, and then click Properties. Click the Security tab. Under Group or user names, click your name to see the permissions you have. Click Edit, click your name, select the check boxes for the permissions that you must have, and then click OK.

How do I reset folder permissions?

Run the following command to reset permissions for a file: icacls "full path to your file" /reset . To reset permissions for a folder: icacls "full path to the folder" /reset . To reset permissions for a folder, its files, and subfolders, run the command icacls "full path to the folder" /reset /t /c /l .

How do I clean up folder permissions?

Right-click on a folder, then choose Properties. Go to Security tab. Click Edit under Groups or user names section. Highlight the user you want to remove, and click Remove.


2 Answers

For us, it was the Cygwin that created files which were showing these problems This thread explains it and possible remedies. cygwin sets file permission to 000

Also, something I wasn't seeing in other threads, our ACL had "NULL SID" in it: see the picture

like image 139
Pik Master Avatar answered Oct 16 '22 09:10

Pik Master


HP has a simple solution:

https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-c00810470

The TL;DR:

Assuming that you have lots of files/folders to fix (like I did) go to the folder above the ones you need to fix. Right-click and choose Properties on that folder, click on the Security tab. Then click the Advanced button at the bottom of the security tab.

HP doesn't tell you this but I had to in the Advanced window take ownership of the folder. The second line of the Advanced dialog lists the Owner of the folder and has a Change... link beside it. Click that link and find the user that you want to own the folder. Click the checkbox to apply this change to all children. You will then be prompted to close all properties dialogs because you have changed ownership.

Back to our regularly scheduled programming:

Go back to the Security tab of the Properties dialog and into the Advanced dialog. Now you can change permissions. I deleted a whole host of "DENY" permissions that had crept in because of (I think) writing the files on a Win 10 Pro computer and accessing them on a Win 10 Home computer with a different user. Again check the option to apply the changes to all children and click OK on all dialogs. Windows will go through your files one at a time resetting permissions.

like image 41
cptully Avatar answered Oct 16 '22 11:10

cptully