diff options
Diffstat (limited to 'winsup/cygwin/sec_acl.cc')
-rw-r--r-- | winsup/cygwin/sec_acl.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index a9e1dea5f..f632410ee 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -1019,8 +1019,17 @@ get_posix_access (PSECURITY_DESCRIPTOR psd, { mode_t perm; - /* If we use the Windows user DB, utilize Authz to make sure all - user permissions are correctly reflecting the Windows + /* Don't merge if the user already has all permissions, or... */ + if (lacl[idx].a_perm == S_IRWXO) + continue; + /* ...if the sum of perms is less than or equal the user's perms. */ + perm = lacl[idx].a_perm + | (has_class_perm ? class_perm : lacl[1].a_perm) + | lacl[2].a_perm; + if (perm == lacl[idx].a_perm) + continue; + /* Otherwise, if we use the Windows user DB, utilize Authz to make + sure all user permissions are correctly reflecting the Windows permissions. */ if (cygheap->pg.nss_pwd_db () && authz_get_user_attribute (&perm, psd, aclsid[idx])) |