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>2002-11-25 14:23:21 +0300
committerCorinna Vinschen <corinna@vinschen.de>2002-11-25 14:23:21 +0300
commitf1da8a066438b2323253e11b10a4037205c1b3c2 (patch)
treec73330658c3d3eadfe850718179a2ce949ee7d51 /winsup/cygwin/sec_acl.cc
parent19f209011a58c2694690b88c8be85fd029f1a88f (diff)
* sec_acl.cc (getacl): Set errno to ENOSPC if command is GETACL and
nentries is less than the number of entries in the file's ACL.
Diffstat (limited to 'winsup/cygwin/sec_acl.cc')
-rw-r--r--winsup/cygwin/sec_acl.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc
index 43f301209..51ac03526 100644
--- a/winsup/cygwin/sec_acl.cc
+++ b/winsup/cygwin/sec_acl.cc
@@ -380,7 +380,10 @@ getacl (const char *file, DWORD attr, int nentries, __aclent16_t *aclbufp)
if (EqualSid (owner_sid, group_sid))
lacl[0].a_perm = lacl[1].a_perm;
if (pos > nentries)
- pos = nentries;
+ {
+ set_errno (ENOSPC);
+ return -1;
+ }
memcpy (aclbufp, lacl, pos * sizeof (__aclent16_t));
for (i = 0; i < pos; ++i)
aclbufp[i].a_perm &= ~(DENY_R | DENY_W | DENY_X);