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>2008-05-22 16:43:18 +0400
committerCorinna Vinschen <corinna@vinschen.de>2008-05-22 16:43:18 +0400
commitc1410a8d1ef1494e945c85cbe19903c2220547fe (patch)
tree4749a928c6b1cb92a88dbc8d0f5709f93b4aab1d /winsup/cygwin/sec_acl.cc
parentb72918135c4d863ef18a4a438cb8276b777cc0aa (diff)
* sec_acl.cc (setacl): Set errno to EINVAL if user or group don't exist.
Diffstat (limited to 'winsup/cygwin/sec_acl.cc')
-rw-r--r--winsup/cygwin/sec_acl.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc
index b1f117416..318a34ff5 100644
--- a/winsup/cygwin/sec_acl.cc
+++ b/winsup/cygwin/sec_acl.cc
@@ -154,9 +154,13 @@ setacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp,
case USER:
case DEF_USER:
if (!(pw = internal_getpwuid (aclbufp[i].a_id))
- || !sid.getfrompw (pw)
- || !add_access_allowed_ace (acl, ace_off++, allow,
- sid, acl_len, inheritance))
+ || !sid.getfrompw (pw))
+ {
+ set_errno (EINVAL);
+ return -1;
+ }
+ if (!add_access_allowed_ace (acl, ace_off++, allow,
+ sid, acl_len, inheritance))
return -1;
break;
case GROUP_OBJ:
@@ -172,9 +176,13 @@ setacl (HANDLE handle, path_conv &pc, int nentries, __aclent32_t *aclbufp,
case GROUP:
case DEF_GROUP:
if (!(gr = internal_getgrgid (aclbufp[i].a_id))
- || !sid.getfromgr (gr)
- || !add_access_allowed_ace (acl, ace_off++, allow,
- sid, acl_len, inheritance))
+ || !sid.getfromgr (gr))
+ {
+ set_errno (EINVAL);
+ return -1;
+ }
+ if (!add_access_allowed_ace (acl, ace_off++, allow,
+ sid, acl_len, inheritance))
return -1;
break;
case OTHER_OBJ: