Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-07-30 14:58:16 +0400
committerCorinna Vinschen <corinna@vinschen.de>2007-07-30 14:58:16 +0400
commit378692ee42bb29280c439600832e84a0ddb7471a (patch)
tree180947c247b5c35e3bc21bbd5d37dc3edb993291
parent73151c54d58148eed83117dfa69f9da404fe53ac (diff)
* fhandler_disk_file.cc (fhandler_disk_file::facl): If file can't be
opened for reading the ACLs, fall back to faking them. * sec_acl.cc (acl_worker): Handle non-existing files. * security.cc (get_file_attribute): Return ILLEGAL_UID/ILLEGAL_GID as owner/group for non-readable ACLs on file systems supporting them.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc9
-rw-r--r--winsup/cygwin/sec_acl.cc2
-rw-r--r--winsup/cygwin/security.cc9
4 files changed, 26 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 85f3303fd..923500513 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,13 @@
2007-07-30 Corinna Vinschen <corinna@vinschen.de>
+ * fhandler_disk_file.cc (fhandler_disk_file::facl): If file can't be
+ opened for reading the ACLs, fall back to faking them.
+ * sec_acl.cc (acl_worker): Handle non-existing files.
+ * security.cc (get_file_attribute): Return ILLEGAL_UID/ILLEGAL_GID
+ as owner/group for non-readable ACLs on file systems supporting them.
+
+2007-07-30 Corinna Vinschen <corinna@vinschen.de>
+
* syscalls.cc (stat_worker): Don't call build_fh_pc with invalid pc.
2007-07-29 Christopher Faylor <me+cygwin@cgf.cx>
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)
{
diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc
index 54d443b17..a0c248fd0 100644
--- a/winsup/cygwin/sec_acl.cc
+++ b/winsup/cygwin/sec_acl.cc
@@ -407,6 +407,8 @@ acl_worker (const char *path, int cmd, int nentries, __aclent32_t *aclbufp,
debug_printf ("got %d error from build_fh_name", fh->error ());
set_errno (fh->error ());
}
+ else if (!fh->exists ())
+ set_errno (ENOENT);
else
res = fh->facl (cmd, nentries, aclbufp);
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc
index 5740446e7..daf2861ed 100644
--- a/winsup/cygwin/security.cc
+++ b/winsup/cygwin/security.cc
@@ -336,6 +336,15 @@ get_file_attribute (HANDLE handle, path_conv &pc,
get_info_from_sd (sd, attribute, uidret, gidret);
return 0;
}
+ else
+ {
+ if (uidret)
+ *uidret = ILLEGAL_UID;
+ if (gidret)
+ *gidret = ILLEGAL_GID;
+
+ return -1;
+ }
}
if (uidret)