![]() |
Qt 6.x
The Qt SDK
|
This class can be used to produce a security descriptor that contains ACL that produces result similar to what is expected for POSIX permission corresponding to the supplied QFileDevice::Permissions
value. When supplied optional value is empty, a null security descriptor is produced. Files or directories with such null security descriptor will inherit ACLs from parent directories. Otherwise an ACL is generated and applied to the security descriptor. The created ACL has permission bits set similar to what Cygwin does. Unlike Cygwin, this code tries to reorder the access control entries (ACE) inside the ACL to match the canonical ordering (deny ACEs followed by allow ACEs) if possible.
The default ordering of ACEs is as follows:
User deny ACE, only lists permission that may be granted by the subsequent Group and Other allow ACEs. User allow ACE. Group deny ACE, only lists permissions that may be granted by the subsequent Other allow ACE. Group allow ACE. Other allow ACE.
Any ACEs that would have zero mask are skipped. Group deny ACE may be moved to before User allow ACE if these 2 ACEs don't have any common mask bits set. This allows use of canonical ordering in more cases. ACLs for permissions with group having less permissions than both user and others (ex.: 0757) are still in noncanonical order. Files with noncanonical ACLs generate warnings when one tries to edit permissions with Windows GUI, and don't work correctly with API like GetEffectiveRightsFromAcl(), but otherwise access checks work fine and such ACLs can still be edited with the "Advanced" GUI.