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>2014-09-03 13:32:53 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-09-03 13:32:53 +0400
commit451e1f48798b3e018cf370c00373bbad25db5ee4 (patch)
tree3a2a3559218f796ad279b0879a462ba55a8cf098
parent89d195a7d1f42c42c21dab188c0e93163d9848a0 (diff)
* setfacl.c (getaclentry): Fix previous fix again. Allow lone 'm' as
well as any lone default entry if action is Delete. Fix comments. (usage): Align usage text.
-rw-r--r--winsup/utils/ChangeLog6
-rw-r--r--winsup/utils/setfacl.c27
2 files changed, 23 insertions, 10 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 97323d0bf..fbea1f11f 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,5 +1,11 @@
2014-09-03 Corinna Vinschen <corinna@vinschen.de>
+ * setfacl.c (getaclentry): Fix previous fix again. Allow lone 'm' as
+ well as any lone default entry if action is Delete. Fix comments.
+ (usage): Align usage text.
+
+2014-09-03 Corinna Vinschen <corinna@vinschen.de>
+
* setfacl.c (getaclentry): Fix return value in case of a lone 'm' if
action is Delete. Drop requirement for a trailing colon if action is
Delete.
diff --git a/winsup/utils/setfacl.c b/winsup/utils/setfacl.c
index a3b2226c3..867838d73 100644
--- a/winsup/utils/setfacl.c
+++ b/winsup/utils/setfacl.c
@@ -109,15 +109,21 @@ getaclentry (action_t action, char *c, aclent_t *ace)
/* Skip to next field. */
c = c2;
if (!*c)
- return action == Delete && (ace->a_type & CLASS_OBJ);
- /* If this is a user or group entry, check if next char is a colon char.
- If so, skip it, otherwise it's the name of a user or group. */
- if (!(ace->a_type & (USER_OBJ | GROUP_OBJ)))
+ {
+ /* Nothing follows. This is only valid if action is Delete and the
+ type is CLASS_OBJ, or if ACL_DEFAULT is set. */
+ if (action != Delete
+ || (!(ace->a_type & (CLASS_OBJ | ACL_DEFAULT))))
+ return FALSE;
+ }
+ else if (!(ace->a_type & (USER_OBJ | GROUP_OBJ)))
{
/* Mask and other entries may contain an extra colon. */
if (*c == ':')
++c;
}
+ /* If this is a user or group entry, check if next char is a colon char.
+ If so, skip it, otherwise it's the name of a user or group. */
else if (*c == ':')
++c;
else if (*c)
@@ -344,12 +350,13 @@ usage (FILE * stream)
" Acl_entries to be deleted should be specified without\n"
" permissions, as in the following list:\n"
"\n"
- " u[ser]:uid\n"
- " g[roup]:gid\n"
- " d[efault]:u[ser]:uid\n"
- " d[efault]:g[roup]:gid\n"
- " d[efault]:m[ask]:\n"
- " d[efault]:o[ther]:\n"
+ " u[ser]:uid[:]\n"
+ " g[roup]:gid[:]\n"
+ " m[ask][:]\n"
+ " d[efault]:u[ser][:uid]\n"
+ " d[efault]:g[roup][:gid]\n"
+ " d[efault]:m[ask][:]\n"
+ " d[efault]:o[ther][:]\n"
"\n"
"-f Take the Acl_entries from ACL_FILE one per line. Whitespace\n"
" characters are ignored, and the character \"#\" may be used\n"