getfacl output

Ken Brown kbrown@cornell.edu
Mon Jul 23 15:15:00 GMT 2018


[Redirecting to cygwin-patches.]

On 7/23/2018 11:06 AM, Corinna Vinschen wrote:
> On Jul 23 10:43, Ken Brown wrote:
>> This is obviously very minor, but I bumped into it because of a failing
>> emacs test.
>>
>> Cygwin's getfacl prints only one colon after "mask" and "other", but Linux's
>> prints two.  I'm sure this was done for a reason, but I'm wondering if it
>> would be better to follow Linux.
> 
> The original version was designed after Solaris documentation,
> but the layout is supposed to look like Linux for a while, so
> ther missing colon is a bug.
> 
>>    I'll be glad to submit a patch.
> 
> Glad to review it :)

Attached.

Ken
-------------- next part --------------
From de841bf40ecdbf93e87d0900d4dd567af32b072f Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Mon, 23 Jul 2018 10:10:03 -0400
Subject: [PATCH] getfacl and setfacl: Align with Linux

Make getfacl print two colons instead of one after "other" and "mask".
Change the help text for setfacl to indicate that there can be either
one colon or two.
---
 winsup/utils/getfacl.c | 12 ++++++------
 winsup/utils/setfacl.c |  6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/winsup/utils/getfacl.c b/winsup/utils/getfacl.c
index 57c58fb6a..363226d6e 100644
--- a/winsup/utils/getfacl.c
+++ b/winsup/utils/getfacl.c
@@ -98,14 +98,14 @@ usage (FILE * stream)
 	"     user:name or uid:perm\n"
 	"     group::perm\n"
 	"     group:name or gid:perm\n"
-	"     mask:perm\n"
-	"     other:perm\n"
+	"     mask::perm\n"
+	"     other::perm\n"
 	"     default:user::perm\n"
 	"     default:user:name or uid:perm\n"
 	"     default:group::perm\n"
 	"     default:group:name or gid:perm\n"
-	"     default:mask:perm\n"
-	"     default:other:perm\n"
+	"     default:mask::perm\n"
+	"     default:other::perm\n"
 	"\n");
     }
 }
@@ -265,10 +265,10 @@ main (int argc, char **argv)
 		n += printf ("group:%s:", groupname (acls[i].a_id));
 	      break;
 	    case CLASS_OBJ:
-	      printf ("mask:");
+	      printf ("mask::");
 	      break;
 	    case OTHER_OBJ:
-	      printf ("other:");
+	      printf ("other::");
 	      break;
 	    }
 	  n += printf ("%s", permstr (acls[i].a_perm));
diff --git a/winsup/utils/setfacl.c b/winsup/utils/setfacl.c
index 373265bf0..2577ab776 100644
--- a/winsup/utils/setfacl.c
+++ b/winsup/utils/setfacl.c
@@ -119,7 +119,7 @@ getaclentry (action_t action, char *c, aclent_t *ace)
     }
   else if (!(ace->a_type & (USER_OBJ | GROUP_OBJ)))
     {
-      /* Mask and other entries may contain an extra colon. */
+      /* Mask and other entries may contain one or two colons. */
       if (*c == ':')
 	++c;
     }
@@ -558,8 +558,8 @@ usage (FILE *stream)
 "    u[ser]:uid:perm\n"
 "    g[roup]::perm\n"
 "    g[roup]:gid:perm\n"
-"    m[ask]:perm\n"
-"    o[ther]:perm\n"
+"    m[ask]:[:]perm\n"
+"    o[ther]:[:]perm\n"
 "\n"
 "  Default entries are like the above with the additional default identifier.\n"
 "  For example: \n"
-- 
2.17.0



More information about the Cygwin-patches mailing list