mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-01 12:00:35 +08:00
Cygwin: facl: fail with EBADF on files opened with O_PATH
This is in the spirit of the Linux requirement that file operations like fchmod(2), fchown(2), and fgetxattr(2) fail with EBADF on files opened with O_PATH.
This commit is contained in:
parent
d4fb892529
commit
6c78e051c0
@ -1246,6 +1246,11 @@ facl32 (int fd, int cmd, int nentries, aclent_t *aclbufp)
|
|||||||
syscall_printf ("-1 = facl (%d)", fd);
|
syscall_printf ("-1 = facl (%d)", fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (cfd->get_flags () & O_PATH)
|
||||||
|
{
|
||||||
|
set_errno (EBADF);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
int res = cfd->facl (cmd, nentries, aclbufp);
|
int res = cfd->facl (cmd, nentries, aclbufp);
|
||||||
syscall_printf ("%R = facl(%s) )", res, cfd->get_name ());
|
syscall_printf ("%R = facl(%s) )", res, cfd->get_name ());
|
||||||
return res;
|
return res;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user