setfacl(2.4.0): colon missing after x (opts string)?

Houder houder@xs4all.nl
Sat Dec 19 13:03:00 GMT 2015


Hi Corinna,

setfacl(2.4.0) does not accept -x <acl_entry> (-d <acl_entry> is 
accepted).

Looking at the source of setfacl.c, I believe a colon is missing after x 
in
the opts string (const char *opts).

Regards,
Henri

newlib-cygwin-2.4.0/gnewlib-cygwin-2.4.0/newlib-cygwin/winsup/utils/setfacl.c

shows:

struct option longopts[] = {
   {"remove-all", no_argument, NULL, 'b'},
   {"delete", required_argument, NULL, 'x'},
   {"file", required_argument, NULL, 'f'},
   {"remove-default", no_argument, NULL, 'k'},
   {"modify", required_argument, NULL, 'm'},
   {"no-mask", required_argument, NULL, 'n'},
   {"mask", required_argument, NULL, '\n'},
   {"replace", no_argument, NULL, 'r'},
   {"substitute", required_argument, NULL, 's'},
   {"help", no_argument, NULL, 'h'},
   {"version", no_argument, NULL, 'V'},
   {0, no_argument, NULL, 0}
};
const char *opts = "bd:f:hkm:nrs:Vx"; <==== colon missing after x ?????

static void
print_version ()
...

-----
64-%% uname -a
CYGWIN_NT-6.1 Seven 2.4.0(0.292/5/3) 2015-12-17 23:10 x86_64 Cygwin

64-%% touch bar.txt
64-%% setfacl -n -m g:Replicator:r-- bar.txt
64-%% icacls bar.txt
bar.txt NULL SID:(DENY)(Rc,S,X,DC)
         Seven\Henri:(R,W,D,WDAC,WO)
         Seven\None:(R)
         BUILTIN\Replicator:(R)
         Everyone:(R)

Successfully processed 1 files; Failed processing 0 files

64-%% setfacl -n -x g:Replicator: bar.txt  # remove it again ...
setfacl: No such file or directory         <==== euh?
64-%% setfacl -n -d g:Replicator: bar.txt
64-%% icacls bar.txt
bar.txt NULL SID:(DENY)(Rc,S,X,DC)
         Seven\Henri:(R,W,D,WDAC,WO)
         Seven\None:(R)
         Everyone:(R)

Successfully processed 1 files; Failed processing 0 files

-----
64-%% setfacl --help
Usage: setfacl [-n] {-f ACL_FILE | -s acl_entries} FILE...
        setfacl [-n] {[-bk]|[-x acl_entries] [-m acl_entries]} FILE...

Modify file and directory access control lists (ACLs)

   -b, --remove-all       remove all extended ACL entries
   -x, --delete           delete one or more specified ACL entries
...

At least one of (-b, -x, -f, -k, -m, -s) must be specified <==== REMOVE 
-x here

   Acl_entries are one or more comma-separated ACL entries from the 
following
   list:

     u[ser]::perm
     u[ser]:uid:perm
     g[roup]::perm
     g[roup]:gid:perm
     m[ask]:perm
     o[ther]:perm
...

-x, --delete
   Delete one or more specified entries from the file's ACL.  The owner, 
group
   and others entries must not be deleted.  Acl_entries to be deleted 
should
   be specified without permissions, as in the following list:

     u[ser]:uid[:]
     g[roup]:gid[:]
     m[ask][:]
     d[efault]:u[ser][:uid]
     d[efault]:g[roup][:gid]
     d[efault]:m[ask][:]
     d[efault]:o[ther][:]

=====

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list