OSDN Git Service

* setfacl.c (getaclentry): Allow to delete default entries for the
authorcorinna <corinna>
Sun, 29 Nov 2009 23:28:29 +0000 (23:28 +0000)
committercorinna <corinna>
Sun, 29 Nov 2009 23:28:29 +0000 (23:28 +0000)
owner and owner group.

winsup/utils/ChangeLog
winsup/utils/setfacl.c

index 927a664..7590509 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-29  Corinna Vinschen  <corinna@vinschen.de>
+
+       * setfacl.c (getaclentry): Allow to delete default entries for the
+       owner and owner group.
+
 2009-11-27  Corinna Vinschen  <corinna@vinschen.de>
 
        * cygcheck.cc (dump_sysinfo): Fix typo in products.
index 5e77c63..e6c622d 100644 (file)
@@ -37,7 +37,7 @@ details. */
 #define ILLEGAL_MODE ((mode_t)0xffffffff)
 #endif
 
-static const char version[] = "$Revision$";
+static const char version[] = "$Revision: 1.13 $";
 static char *prog_name;
 
 typedef enum {
@@ -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)
            {