* [PATCH] nfs4_getfacl: Add support to accept more paths
@ 2018-01-30 19:23 Kenneth Dsouza
2018-01-31 20:16 ` J. Bruce Fields
0 siblings, 1 reply; 3+ messages in thread
From: Kenneth Dsouza @ 2018-01-30 19:23 UTC (permalink / raw)
To: linux-nfs; +Cc: bfields
Currently, nfs4_getfacl accepts only a single path at a time, which
makes us run the command several times.
This patch will help us to list (ACL) on multiple files at a time.
nfs4getfacl file ...
---
nfs4_getfacl/nfs4_getfacl.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/nfs4_getfacl/nfs4_getfacl.c b/nfs4_getfacl/nfs4_getfacl.c
index 5363096..bbbbb62 100644
--- a/nfs4_getfacl/nfs4_getfacl.c
+++ b/nfs4_getfacl/nfs4_getfacl.c
@@ -48,17 +48,13 @@ int main(int argc, char **argv)
{
struct nfs4_acl *acl;
int res = 1;
-
+ int count = 1;
execname = basename(argv[0]);
if (argc < 2) {
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,12 +64,15 @@ int main(int argc, char **argv)
res = 0;
goto out;
}
- acl = nfs4_acl_for_path(argv[1]);
+ for (counter = 1; counter < agrc; 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;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nfs4_getfacl: Add support to accept more paths
2018-01-30 19:23 [PATCH] nfs4_getfacl: Add support to accept more paths Kenneth Dsouza
@ 2018-01-31 20:16 ` J. Bruce Fields
2018-01-31 20:32 ` Kenneth Dsouza
0 siblings, 1 reply; 3+ messages in thread
From: J. Bruce Fields @ 2018-01-31 20:16 UTC (permalink / raw)
To: Kenneth Dsouza; +Cc: linux-nfs
On Wed, Jan 31, 2018 at 12:53:04AM +0530, Kenneth Dsouza wrote:
> Currently, nfs4_getfacl accepts only a single path at a time, which
> makes us run the command several times.
> This patch will help us to list (ACL) on multiple files at a time.
> nfs4getfacl file ...
Looks fine, thanks.
Just a couple whitespace nits:
> diff --git a/nfs4_getfacl/nfs4_getfacl.c b/nfs4_getfacl/nfs4_getfacl.c
> index 5363096..bbbbb62 100644
> --- a/nfs4_getfacl/nfs4_getfacl.c
> +++ b/nfs4_getfacl/nfs4_getfacl.c
> @@ -48,17 +48,13 @@ int main(int argc, char **argv)
> {
> struct nfs4_acl *acl;
> int res = 1;
> -
No need to delete that blank line.
> + int count = 1;
> execname = basename(argv[0]);
>
> if (argc < 2) {
> 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,12 +64,15 @@ int main(int argc, char **argv)
> res = 0;
> goto out;
> }
> - acl = nfs4_acl_for_path(argv[1]);
> + for (counter = 1; counter < agrc; 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;
> }
Fix the indentation here (the body of the loop should be indented.)
Actually the patch looks like the whitespace has been mangled somehow.
(For example the indentation is all tabs, not spaces, in the original.)
You might check
https://www.kernel.org/doc/html/v4.11/process/email-clients.html
and see if it has any hints for your email client.
--b.
> + }
> out:
> return res;
> }
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nfs4_getfacl: Add support to accept more paths
2018-01-31 20:16 ` J. Bruce Fields
@ 2018-01-31 20:32 ` Kenneth Dsouza
0 siblings, 0 replies; 3+ messages in thread
From: Kenneth Dsouza @ 2018-01-31 20:32 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: linux-nfs
Thanks Bruce,
I will do the needful and send a revised patch.
Regards,
Kenneth D'souza
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-31 20:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-30 19:23 [PATCH] nfs4_getfacl: Add support to accept more paths Kenneth Dsouza
2018-01-31 20:16 ` J. Bruce Fields
2018-01-31 20:32 ` 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.