Re: [PATCH] nfs4_getfacl: Add new option -c/--omit-header to not display comment header.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 10, 2019 at 2:04 AM J. Bruce Fields <bfields@xxxxxxxxxxxx> wrote:
>
> Thanks, applying with some fixes:
>
> On Tue, Mar 26, 2019 at 07:27:40PM +0530, Kenneth D'souza wrote:
> > With this patch the filename will not be printed.
> >
> >     $ nfs4_getfacl /test/
> >     # file: /test/
> >     A::OWNER@:rwaDxtTcCy
> >     A::GROUP@:rwaDxtcy
> >     A::EVERYONE@:rwaDxtcy
> >
> >     $ nfs4_getfacl -c /test/
> >
> >     A::OWNER@:rwaDxtTcCy
> >     A::GROUP@:rwaDxtcy
> >     A::EVERYONE@:rwaDxtcy
>
> I don't see any reason for that blank line, I've removed it.
>
I added the blank line so we print acl for each file on a new line
when -c is used.
# nfs4_getfacl -Rc /test

A::OWNER@:rwaDxtTcCy
A::GROUP@:rwaDxtcy
A::EVERYONE@:rwaDxtcy

A::OWNER@:rwatTcCy
A::GROUP@:tcy
A::EVERYONE@:tcy

A::OWNER@:rwaDxtTcCy
A::GROUP@:rxtcy
A::EVERYONE@:rxtcy


> > @@ -115,7 +119,10 @@ static void print_acl_from_path(const char *fpath)
> >       struct nfs4_acl *acl;
> >       acl = nfs4_acl_for_path(fpath);
> >       if (acl != NULL) {
> > +             if(ignore_comment == 0)
> >               printf("\n# file: %s\n", fpath);
>
> This needs to be indented.
>
> > +             else
> > +                     printf("\n");
>
> I've removed the "else" clause.
>
> And fixed a couple minor whitespace issues.
>
> --b.
>
> >               nfs4_print_acl(stdout, acl);
> >               nfs4_free_acl(acl);
> >       }
> > @@ -125,7 +132,7 @@ static void usage(int label)
> >  {
> >       if (label)
> >               fprintf(stderr, "%s %s -- get NFSv4 file or directory access control lists.\n", execname, VERSION);
> > -     fprintf(stderr, "Usage: %s [-R] file ...\n  -H, --more-help\tdisplay ACL format information\n  -?, -h, --help\tdisplay this help text\n  -R --recursive\trecurse into subdirectories\n", execname);
> > +     fprintf(stderr, "Usage: %s [-R] file ...\n  -H, --more-help\tdisplay ACL format information\n  -?, -h, --help\tdisplay this help text\n  -R --recursive\trecurse into subdirectories\n  -c, --omit-header\tDo not display the comment header (Do not print filename)\n", execname);
> >  }
> >
> >  static void more_help()
> > --
> > 2.20.1



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux