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
parentb72918135c4d863ef18a4a438cb8276b777cc0aa (diff)
* sec_acl.cc (setacl): Set errno to EINVAL if user or group don't exist.
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/sec_acl.cc20
2 files changed, 18 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 1ecefe1a9..11362be74 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2008-05-22 Corinna Vinschen <corinna@vinschen.de>
+ * sec_acl.cc (setacl): Set errno to EINVAL if user or group don't exist.
+
+2008-05-22 Corinna Vinschen <corinna@vinschen.de>
+
* path.cc (cygwin_conv_path): Define tp before setting up faul handler.
* syscalls.cc: Ditto, throughout.
(gen_full_path_at): Add bool parameter to allow NULL pathname.
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: