From: "J. Bruce Fields" <bfields@fieldses.org>
To: Kenneth Dsouza <kdsouza@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfs4_getfacl: Add new option -c/--omit-header to not display comment header.
Date: Wed, 10 Apr 2019 09:26:07 -0400 [thread overview]
Message-ID: <20190410132607.GA2714@fieldses.org> (raw)
In-Reply-To: <CAA_-hQ+fhGCiue4aGZiDtdHy1_grHCnSPa8q8-bMdnxE-PP=AA@mail.gmail.com>
On Wed, Apr 10, 2019 at 03:07:11PM +0530, Kenneth Dsouza wrote:
> On Wed, Apr 10, 2019 at 2:04 AM J. Bruce Fields <bfields@fieldses.org> 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.
OK, it does make sense to have a blank line between multiple ACLs.
Again I'd rather adopt the same behavior has getfacl/setfacl whenever we
can. Looks like getfacl just appends a blank line regardless of whether
-c is used or whether the are multiple ACLs:
[bfields@patate ~]$ getfacl .
# file: .
# owner: bfields
# group: bfields
user::rwx
group::--x
other::--x
[bfields@patate ~]$
I've added that to print_acl_from_path().
--b.
> # 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
next prev parent reply other threads:[~2019-04-10 13:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-26 13:57 [PATCH] nfs4_getfacl: Add new option -c/--omit-header to not display comment header Kenneth D'souza
2019-04-09 20:34 ` J. Bruce Fields
2019-04-10 9:37 ` Kenneth Dsouza
2019-04-10 13:26 ` J. Bruce Fields [this message]
2019-04-10 13:33 ` Kenneth Dsouza
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190410132607.GA2714@fieldses.org \
--to=bfields@fieldses.org \
--cc=kdsouza@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.