summaryrefslogtreecommitdiffstats
path: root/winsup/utils/setfacl.c
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/utils/setfacl.c')
-rw-r--r--winsup/utils/setfacl.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/winsup/utils/setfacl.c b/winsup/utils/setfacl.c
index 5e77c63d5..0dcf95cf9 100644
--- a/winsup/utils/setfacl.c
+++ b/winsup/utils/setfacl.c
@@ -120,9 +120,18 @@ getaclentry (action_t action, char *c, aclent_t *ace)
return FALSE;
*c2 = '\0';
}
- else if (action != Delete)
+ else if (action == Delete)
+ {
+ /* Only default ugo entries are allowed to be removed, not the
+ standard ugo entries. */
+ if (!(ace->a_type & ACL_DEFAULT))
+ return FALSE;
+ }
+ else
return FALSE;
- if (c2 == c)
+ if (!c2 && !*c) /* Deleting a default ug entry is allowed. */
+ ;
+ else if (c2 == c)
{
if (action == Delete)
return FALSE;
@@ -149,7 +158,7 @@ getaclentry (action_t action, char *c, aclent_t *ace)
return FALSE;
ace->a_id = gr->gr_gid;
}
- if (c2 != c)
+ if (c2 && c2 != c)
{
if (ace->a_type & USER_OBJ)
{