public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* setfacl(2.4.0): colon missing after x (opts string)?
@ 2015-12-19 13:03 Houder
  2015-12-19 20:51 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Houder @ 2015-12-19 13:03 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: setfacl(2.4.0): colon missing after x (opts string)?
  2015-12-19 13:03 setfacl(2.4.0): colon missing after x (opts string)? Houder
@ 2015-12-19 20:51 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2015-12-19 20:51 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

On Dec 19 14:03, Houder wrote:
> 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 ?????

Indeed,  Thanks for catching.  Patch applied.  I'm going to upload
a 0-13 test relese with this patch in a bit.


Thanks again,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-19 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-19 13:03 setfacl(2.4.0): colon missing after x (opts string)? Houder
2015-12-19 20:51 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).