* 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.
This commit is contained in:
Corinna Vinschen 2014-09-03 09:32:53 +00:00
parent 89d195a7d1
commit 451e1f4879
2 changed files with 23 additions and 10 deletions

View File

@ -1,3 +1,9 @@
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> 2014-09-03 Corinna Vinschen <corinna@vinschen.de>
* setfacl.c (getaclentry): Fix return value in case of a lone 'm' if * setfacl.c (getaclentry): Fix return value in case of a lone 'm' if

View File

@ -109,15 +109,21 @@ getaclentry (action_t action, char *c, aclent_t *ace)
/* Skip to next field. */ /* Skip to next field. */
c = c2; c = c2;
if (!*c) 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. /* Nothing follows. This is only valid if action is Delete and the
If so, skip it, otherwise it's the name of a user or group. */ type is CLASS_OBJ, or if ACL_DEFAULT is set. */
if (!(ace->a_type & (USER_OBJ | GROUP_OBJ))) 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. */ /* Mask and other entries may contain an extra colon. */
if (*c == ':') if (*c == ':')
++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 == ':') else if (*c == ':')
++c; ++c;
else if (*c) else if (*c)
@ -344,12 +350,13 @@ usage (FILE * stream)
" Acl_entries to be deleted should be specified without\n" " Acl_entries to be deleted should be specified without\n"
" permissions, as in the following list:\n" " permissions, as in the following list:\n"
"\n" "\n"
" u[ser]:uid\n" " u[ser]:uid[:]\n"
" g[roup]:gid\n" " g[roup]:gid[:]\n"
" d[efault]:u[ser]:uid\n" " m[ask][:]\n"
" d[efault]:g[roup]:gid\n" " d[efault]:u[ser][:uid]\n"
" d[efault]:m[ask]:\n" " d[efault]:g[roup][:gid]\n"
" d[efault]:o[ther]:\n" " d[efault]:m[ask][:]\n"
" d[efault]:o[ther][:]\n"
"\n" "\n"
"-f Take the Acl_entries from ACL_FILE one per line. Whitespace\n" "-f Take the Acl_entries from ACL_FILE one per line. Whitespace\n"
" characters are ignored, and the character \"#\" may be used\n" " characters are ignored, and the character \"#\" may be used\n"