All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] nfs4_getfacl: Add support to accept more paths
@ 2018-02-02 20:33 Kenneth Dsouza
  2018-02-02 21:19 ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Kenneth Dsouza @ 2018-02-02 20:33 UTC (permalink / raw)
  To: linux-nfs; +Cc: J. Bruce Fields

Update man page with information for multiple file path support.

Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
---
 man/man1/nfs4_getfacl.1     |  7 ++++++-
 nfs4_getfacl/nfs4_getfacl.c | 18 +++++++++---------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/man/man1/nfs4_getfacl.1 b/man/man1/nfs4_getfacl.1
index fc092be..b556e1a 100644
--- a/man/man1/nfs4_getfacl.1
+++ b/man/man1/nfs4_getfacl.1
@@ -9,7 +9,7 @@
 nfs4_getfacl \- get NFSv4 file/directory access control lists
 .SH SYNOPSIS
 .B nfs4_getfacl [-H]
-.I file
+file ...
 .SH DESCRIPTION
 .B nfs4_getfacl
 will display the NFSv4 Access Control List (ACL) for
@@ -28,6 +28,7 @@ The output format for an NFSv4 file ACL, e.g., is:
 .RS
 .nf

+# file: /somedir
 A::OWNER@:rwatTnNcCy
 A::alice@nfsdomain.org:rxtncy
 A::bob@nfsdomain.org:rwadtTnNcCy
@@ -42,6 +43,10 @@ In the example output above, the user
`alice@nfsdomain.org' has the equivalent
 of "read" and "execute" permissions, `bob@nfsdomain.org' has "read" and
 "write", and both `GROUP@' and `EVERYONE@' have "read".

+.B nfs4_getfacl
+reads a list of files from standard input. The ACL listings of
+multiple files are separated by blank lines.
+
 Refer to the
 .BR nfs4_acl (5)
 manpage for detailed information about NFSv4 ACL terminology and syntax.
diff --git a/nfs4_getfacl/nfs4_getfacl.c b/nfs4_getfacl/nfs4_getfacl.c
index 5363096..b5f72c7 100644
--- a/nfs4_getfacl/nfs4_getfacl.c
+++ b/nfs4_getfacl/nfs4_getfacl.c
@@ -48,6 +48,7 @@ int main(int argc, char **argv)
 {
        struct nfs4_acl *acl;
        int res = 1;
+       int counter = 1;

        execname = basename(argv[0]);

@@ -55,10 +56,6 @@ int main(int argc, char **argv)
                fprintf(stderr, "%s: you must specify a path.\n", execname);
                usage(0);
                goto out;
-       } else if (argc > 2) {
-               fprintf(stderr, "%s: currently, you may only specify a
single path.\n", execname);
-               usage(0);
-               goto out;
        } else if (!strcmp(argv[1], "-?") || !strcmp(argv[1], "-h") ||
!strcmp(argv[1], "--help")) {
                usage(1);
                res = 0;
@@ -68,11 +65,14 @@ int main(int argc, char **argv)
                res = 0;
                goto out;
        }
-       acl = nfs4_acl_for_path(argv[1]);
-       if (acl != NULL) {
-               nfs4_print_acl(stdout, acl);
-               nfs4_free_acl(acl);
-               res = 0;
+       for (counter = 1; counter < argc; counter++) {
+               acl = nfs4_acl_for_path(argv[counter]);
+               if (acl != NULL) {
+                       printf("\n# file: %s\n",argv[counter]);
+                       nfs4_print_acl(stdout, acl);
+                       nfs4_free_acl(acl);
+                       res = 0;
+               }
        }
 out:
        return res;
--
2.9.5

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

* Re: [PATCH v2] nfs4_getfacl: Add support to accept more paths
  2018-02-02 20:33 [PATCH v2] nfs4_getfacl: Add support to accept more paths Kenneth Dsouza
@ 2018-02-02 21:19 ` J. Bruce Fields
  2018-02-03 15:40   ` Kenneth Dsouza
  0 siblings, 1 reply; 3+ messages in thread
From: J. Bruce Fields @ 2018-02-02 21:19 UTC (permalink / raw)
  To: Kenneth Dsouza; +Cc: linux-nfs

Thanks, one nit:

On Sat, Feb 03, 2018 at 02:03:31AM +0530, Kenneth Dsouza wrote:
> Update man page with information for multiple file path support.
> 
> Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
> ---
>  man/man1/nfs4_getfacl.1     |  7 ++++++-
>  nfs4_getfacl/nfs4_getfacl.c | 18 +++++++++---------
>  2 files changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/man/man1/nfs4_getfacl.1 b/man/man1/nfs4_getfacl.1
> index fc092be..b556e1a 100644
> --- a/man/man1/nfs4_getfacl.1
> +++ b/man/man1/nfs4_getfacl.1
> @@ -9,7 +9,7 @@
>  nfs4_getfacl \- get NFSv4 file/directory access control lists
>  .SH SYNOPSIS
>  .B nfs4_getfacl [-H]
> -.I file
> +file ...
>  .SH DESCRIPTION
>  .B nfs4_getfacl
>  will display the NFSv4 Access Control List (ACL) for
> @@ -28,6 +28,7 @@ The output format for an NFSv4 file ACL, e.g., is:
>  .RS
>  .nf
> 
> +# file: /somedir
>  A::OWNER@:rwatTnNcCy
>  A::alice@nfsdomain.org:rxtncy
>  A::bob@nfsdomain.org:rwadtTnNcCy
> @@ -42,6 +43,10 @@ In the example output above, the user
> `alice@nfsdomain.org' has the equivalent
>  of "read" and "execute" permissions, `bob@nfsdomain.org' has "read" and
>  "write", and both `GROUP@' and `EVERYONE@' have "read".
> 
> +.B nfs4_getfacl
> +reads a list of files from standard input. The ACL listings of
> +multiple files are separated by blank lines.
> +

The list of files comes from the command line arguments, not standard
input, right?

I've modified the man page slightly but otherwise taken your patch
unchanged; result is pushed out to git now, let me know if it looks OK
to you.

--b.

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

* Re: [PATCH v2] nfs4_getfacl: Add support to accept more paths
  2018-02-02 21:19 ` J. Bruce Fields
@ 2018-02-03 15:40   ` Kenneth Dsouza
  0 siblings, 0 replies; 3+ messages in thread
From: Kenneth Dsouza @ 2018-02-03 15:40 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs

On Sat, Feb 3, 2018 at 2:49 AM, J. Bruce Fields <bfields@fieldses.org> wrote:
> Thanks, one nit:
>
> On Sat, Feb 03, 2018 at 02:03:31AM +0530, Kenneth Dsouza wrote:
>> Update man page with information for multiple file path support.
>>
>> Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
>> ---
>>  man/man1/nfs4_getfacl.1     |  7 ++++++-
>>  nfs4_getfacl/nfs4_getfacl.c | 18 +++++++++---------
>>  2 files changed, 15 insertions(+), 10 deletions(-)
>>
>> diff --git a/man/man1/nfs4_getfacl.1 b/man/man1/nfs4_getfacl.1
>> index fc092be..b556e1a 100644
>> --- a/man/man1/nfs4_getfacl.1
>> +++ b/man/man1/nfs4_getfacl.1
>> @@ -9,7 +9,7 @@
>>  nfs4_getfacl \- get NFSv4 file/directory access control lists
>>  .SH SYNOPSIS
>>  .B nfs4_getfacl [-H]
>> -.I file
>> +file ...
>>  .SH DESCRIPTION
>>  .B nfs4_getfacl
>>  will display the NFSv4 Access Control List (ACL) for
>> @@ -28,6 +28,7 @@ The output format for an NFSv4 file ACL, e.g., is:
>>  .RS
>>  .nf
>>
>> +# file: /somedir
>>  A::OWNER@:rwatTnNcCy
>>  A::alice@nfsdomain.org:rxtncy
>>  A::bob@nfsdomain.org:rwadtTnNcCy
>> @@ -42,6 +43,10 @@ In the example output above, the user
>> `alice@nfsdomain.org' has the equivalent
>>  of "read" and "execute" permissions, `bob@nfsdomain.org' has "read" and
>>  "write", and both `GROUP@' and `EVERYONE@' have "read".
>>
>> +.B nfs4_getfacl
>> +reads a list of files from standard input. The ACL listings of
>> +multiple files are separated by blank lines.
>> +
>
> The list of files comes from the command line arguments, not standard
> input, right?
   Yes

> I've modified the man page slightly but otherwise taken your patch
> unchanged; result is pushed out to git now, let me know if it looks OK
> to you.
>
> --b.

 It looks good. Thank you for fixing it.

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

end of thread, other threads:[~2018-02-03 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-02 20:33 [PATCH v2] nfs4_getfacl: Add support to accept more paths Kenneth Dsouza
2018-02-02 21:19 ` J. Bruce Fields
2018-02-03 15:40   ` Kenneth Dsouza

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.