diff options
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 46b178fb7..a5a7c4b53 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -841,6 +841,7 @@ fhandler_disk_file::facl (int cmd, int nentries, __aclent32_t *aclbufp) if (!pc.has_acls () || !allow_ntsec) { +cant_access_acl: switch (cmd) { struct __stat64 st; @@ -895,9 +896,13 @@ fhandler_disk_file::facl (int cmd, int nentries, __aclent32_t *aclbufp) { if (!get_handle ()) { - query_open (cmd == SETACL ? query_write_control : query_read_attributes); + query_open (cmd == SETACL ? query_write_control : query_read_control); if (!(oret = open (O_BINARY, 0))) - return -1; + { + if (cmd == GETACL || cmd == GETACLCNT) + goto cant_access_acl; + return -1; + } } switch (cmd) { |