OSDN Git Service

* sec_acl.cc (getacl): Set errno to ENOSPC if command is GETACL and
authorcorinna <corinna>
Mon, 25 Nov 2002 11:23:20 +0000 (11:23 +0000)
committercorinna <corinna>
Mon, 25 Nov 2002 11:23:20 +0000 (11:23 +0000)
nentries is less than the number of entries in the file's ACL.

winsup/cygwin/ChangeLog
winsup/cygwin/sec_acl.cc

index 93903fd..53caea2 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-25  Corinna Vinschen  <corinna@vinschen.de>
+
+       * 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.
+
 2002-11-24  Corinna Vinschen  <corinna@vinschen.de>
 
        * sec_acl.cc: Fix some formatting.  Only set and check `other' bits in
index 43f3012..51ac035 100644 (file)
@@ -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);