From patchwork Fri Feb 2 20:33:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenneth Dsouza X-Patchwork-Id: 10198103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0859F60388 for ; Fri, 2 Feb 2018 20:33:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECE5828F50 for ; Fri, 2 Feb 2018 20:33:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E198E28F75; Fri, 2 Feb 2018 20:33:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 840BF28F50 for ; Fri, 2 Feb 2018 20:33:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752352AbeBBUdi (ORCPT ); Fri, 2 Feb 2018 15:33:38 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:41866 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752334AbeBBUde (ORCPT ); Fri, 2 Feb 2018 15:33:34 -0500 Received: by mail-lf0-f66.google.com with SMTP id f136so33284572lff.8 for ; Fri, 02 Feb 2018 12:33:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=C0YDcKG7l7c1PgD4STtqqSDxmBI895/sVcNQMBi9fQ8=; b=CUlMlPmKTvw8yOT6Hu0ukZ7j0HIbleni6o2qc2ZzWszMNW+aJ+1N1NRDTBhGLZ95dw fG0qt7WoHCtKfEaPcBQDmh7f83yhzaLIy5DaAojO+Q2PfKXl/sn+P77+m9vjxwmrO88o SsfwQrS8UgLr6ATnB9rK0rGQ01GyHlminaqGIYhGJQd3c19YFH8lz7/Ik+vGkOjILVAn /ItYlmMeTtwzGbDJf2Vd8RN+QUarppJLMYdhKpb4EL6g5ZqxACVC5xLO9dOJ4xew02QO tYAakrntmZPPCOiPJtXncs/PZoe3VWn2zG5vsvOmPrcrKR1My4uwo0XhbdTHGbk6J0L+ bxww== X-Gm-Message-State: AKwxytd6myHiCv1kEDOPy83MInUF+snDcXgfkhI3vnnMtqj5n1nh46Yq Xk09gZWwT/5U0R5bRiSpGS2EIpDqnEhfH+K9lPOdvUC9 X-Google-Smtp-Source: AH8x2248W0fxzJOTTQIJIr32KIJqGMJ6vMZtOR1S6RA2G/+VhtwEHl8h+MU6tVsPx20sZlgpmgk7bOsnyZiduDA6XNE= X-Received: by 10.25.121.21 with SMTP id u21mr21633067lfc.79.1517603612135; Fri, 02 Feb 2018 12:33:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.17.221 with HTTP; Fri, 2 Feb 2018 12:33:31 -0800 (PST) From: Kenneth Dsouza Date: Sat, 3 Feb 2018 02:03:31 +0530 Message-ID: Subject: [PATCH v2] nfs4_getfacl: Add support to accept more paths To: linux-nfs@vger.kernel.org Cc: "J. Bruce Fields" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update man page with information for multiple file path support. Signed-off-by: Kenneth D'souza --- man/man1/nfs4_getfacl.1 | 7 ++++++- nfs4_getfacl/nfs4_getfacl.c | 18 +++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) 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 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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")) {