mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
* sec_acl.cc (setacl): Align standard owner and group permissions
with alloc_sd. Strip FILE_READ_ATTRIBUTES fromn setting FILE_GENERIC_EXECUTE permissions same as in alloc_sd. * security.cc (alloc_sd): Reformat expression. Strip EA permission bits from owner_deny and group_deny computation.
This commit is contained in:
parent
423fd4f2f4
commit
5f9ca0d25a
@ -1,3 +1,11 @@
|
||||
2008-10-13 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* sec_acl.cc (setacl): Align standard owner and group permissions
|
||||
with alloc_sd. Strip FILE_READ_ATTRIBUTES fromn setting
|
||||
FILE_GENERIC_EXECUTE permissions same as in alloc_sd.
|
||||
* security.cc (alloc_sd): Reformat expression. Strip EA permission
|
||||
bits from owner_deny and group_deny computation.
|
||||
|
||||
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Check
|
||||
|
@ -104,18 +104,21 @@ setacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp,
|
||||
DWORD allow;
|
||||
/* Owner has more standard rights set. */
|
||||
if ((aclbufp[i].a_type & ~ACL_DEFAULT) == USER_OBJ)
|
||||
allow = STANDARD_RIGHTS_ALL | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA;
|
||||
allow = STANDARD_RIGHTS_ALL
|
||||
| (pc.fs_is_samba ()
|
||||
? 0 : (FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES));
|
||||
else
|
||||
allow = STANDARD_RIGHTS_READ | FILE_READ_ATTRIBUTES | FILE_READ_EA;
|
||||
allow = STANDARD_RIGHTS_READ
|
||||
| (pc.fs_is_samba () ? 0 : FILE_READ_ATTRIBUTES);
|
||||
if (aclbufp[i].a_perm & S_IROTH)
|
||||
allow |= FILE_GENERIC_READ;
|
||||
if (aclbufp[i].a_perm & S_IWOTH)
|
||||
{
|
||||
allow |= STANDARD_RIGHTS_WRITE | FILE_GENERIC_WRITE;
|
||||
allow |= FILE_GENERIC_WRITE;
|
||||
writable = true;
|
||||
}
|
||||
if (aclbufp[i].a_perm & S_IXOTH)
|
||||
allow |= FILE_GENERIC_EXECUTE;
|
||||
allow |= FILE_GENERIC_EXECUTE & ~FILE_READ_ATTRIBUTES;
|
||||
if ((aclbufp[i].a_perm & (S_IWOTH | S_IXOTH)) == (S_IWOTH | S_IXOTH))
|
||||
allow |= FILE_DELETE_CHILD;
|
||||
/* Set inherit property. */
|
||||
|
@ -479,8 +479,8 @@ alloc_sd (path_conv &pc, __uid32_t uid, __gid32_t gid, int attribute,
|
||||
owner_allow |= FILE_DELETE_CHILD;
|
||||
|
||||
/* Construct allow attribute for group. */
|
||||
DWORD group_allow = STANDARD_RIGHTS_READ |
|
||||
(pc.fs_is_samba () ? 0 : FILE_READ_ATTRIBUTES);
|
||||
DWORD group_allow = STANDARD_RIGHTS_READ
|
||||
| (pc.fs_is_samba () ? 0 : FILE_READ_ATTRIBUTES);
|
||||
if (attribute & S_IRGRP)
|
||||
group_allow |= FILE_GENERIC_READ;
|
||||
if (attribute & S_IWGRP)
|
||||
@ -526,12 +526,10 @@ alloc_sd (path_conv &pc, __uid32_t uid, __gid32_t gid, int attribute,
|
||||
|
||||
DWORD owner_deny = ~owner_allow & (group_allow | other_allow);
|
||||
owner_deny &= ~(STANDARD_RIGHTS_READ
|
||||
| FILE_READ_ATTRIBUTES | FILE_READ_EA
|
||||
| FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA);
|
||||
| FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES);
|
||||
|
||||
DWORD group_deny = ~group_allow & other_allow;
|
||||
group_deny &= ~(STANDARD_RIGHTS_READ
|
||||
| FILE_READ_ATTRIBUTES | FILE_READ_EA);
|
||||
group_deny &= ~(STANDARD_RIGHTS_READ | FILE_READ_ATTRIBUTES);
|
||||
|
||||
/* Set deny ACE for owner. */
|
||||
if (owner_deny
|
||||
|
Loading…
x
Reference in New Issue
Block a user