Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1808418iob; Sat, 14 May 2022 22:20:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx87W72pWzLrTXnLfQ6k8kt22xqlWLBOf2qL4gFrpStbXdPmH4RDnkJvhWmDSDodt0CHVbX X-Received: by 2002:a17:907:7204:b0:6f4:2c26:5f7 with SMTP id dr4-20020a170907720400b006f42c2605f7mr10432441ejc.506.1652592021471; Sat, 14 May 2022 22:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652592021; cv=none; d=google.com; s=arc-20160816; b=f2FLScd2HM622ZlzSzp8lkN6tM9rpNQcGctmyDdZvUmUaePg4PzcNPxcuB1uk7+BbI ZzP8q5pR0BVYCjDF6HQ8+SoESeC5JQhIo/xPgvV76injJrypQyXvjr+ysXKeFgPKvIgz ijQF0tMNjYII3cOdPDDl/WosR4HI91pVmM9i2/uNo/R9MwuGE71qj2nXbmykTMzwQpBh hL6QcSOyeceH2qUJe/ewRCNF4mOKjeDU3OcI2eYWVQuHnzHm9mRPoceC1hzJF+XlkgJ9 ncjdQRoKhHo7vtE++iTQxHOQNZ8xGv9wIkqoUhJmS151ID0h4EVSp2uqiDykw+3a7g8R NbPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c4BBLYVhidLpi7XzQMO1Z39W9GOrBpQdjmLrFxP8yAY=; b=aV9gtBG73wdL7R5ifOgQiUdkImJG/2+8r3l67VaNtvVdXiJcX7D0U+QCVY4ek7x6bQ vOnuI2DncEs5/XLKcdD7FezmIGCkhEr7m8kPPeKTLDUYaYPbq0MWcTjUU/jk0onwwd4l nF3Qg0gA/9xw7XfV4xLLGelTEOSPljQ7VcsG9cYZFcOY17ymMuJVpFoWnqkEmmsyEoB9 eiXuYEtZ19TLXk3RNpe9DrGrlKMXskdKS/caRuNifGJibJlxLnNEmI1zhT4YHyieR321 MxhM/j7ysMgicUIJXgulXsr9mP5injgcsMHbQNOEsW3PmRpIofH9kA1uBvjhqNZ+2zcI aZjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RqvmXh5y; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd10-20020a1709069b8a00b006e8310f72e9si6710380ejc.653.2022.05.14.22.19.37; Sat, 14 May 2022 22:20:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RqvmXh5y; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233490AbiENOvQ (ORCPT + 99 others); Sat, 14 May 2022 10:51:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233707AbiENOvD (ORCPT ); Sat, 14 May 2022 10:51:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9198517ABC for ; Sat, 14 May 2022 07:50:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4F6D7B808CF for ; Sat, 14 May 2022 14:50:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 914EFC340EE; Sat, 14 May 2022 14:50:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652539844; bh=WEC8PsRGlYw3jcNP/Ogg7WlmDdggce5Cl0kX0a7nASo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RqvmXh5yHPLQGg4+OKwINl5mk5x74HeZvygiiGIWIMk3+QnOWm/2MmjRYsyYgjYoc sPslKIhzEhFbI6k5Z0UxuscpTxRphsPzA0MglAnLSpk57rrH2HJmym7NyoYyRmhclG IMs6UdCNWIBNp6J1I2cs79rOIbS/GhH/OiieeKNk586jVC3wOTpQiyHA+w8NR/UplK RhE17UiirkL1mfE9PfN+wKeLj4pLro4cLWoUvfXM/TKisfq7bVDL5yv7Inqvigqc5y zvqcR5SHgpmaSufORgK+b71+2YT5rxn+Lq1wXuoMLwdQrKLCEK9GoQSOL1DcDXW/xh cUBNN86IRgYig== From: trondmy@kernel.org To: Steve Dickson , "J.Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/6] libnfs4acl: Add support for the NFS4.1 ACE_INHERITED_ACE flag Date: Sat, 14 May 2022 10:44:32 -0400 Message-Id: <20220514144436.4298-3-trondmy@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220514144436.4298-2-trondmy@kernel.org> References: <20220514144436.4298-1-trondmy@kernel.org> <20220514144436.4298-2-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Use the letter 'I' to represent an inherited ACE. Signed-off-by: Trond Myklebust --- include/libacl_nfs4.h | 1 + include/nfs4.h | 1 + libnfs4acl/nfs4_ace_from_string.c | 3 +++ libnfs4acl/nfs4_get_ace_flags.c | 2 ++ nfs4_getfacl/nfs4_getfacl.c | 1 + 5 files changed, 8 insertions(+) diff --git a/include/libacl_nfs4.h b/include/libacl_nfs4.h index 76bbe90af54d..d54d82f94f97 100644 --- a/include/libacl_nfs4.h +++ b/include/libacl_nfs4.h @@ -54,6 +54,7 @@ #define FLAG_SUCCESSFUL_ACCESS 'S' #define FLAG_FAILED_ACCESS 'F' #define FLAG_GROUP 'g' +#define FLAG_INHERITED 'I' #define PERM_READ_DATA 'r' #define PERM_WRITE_DATA 'w' diff --git a/include/nfs4.h b/include/nfs4.h index da6eefb7fbc6..20bfa6b99634 100644 --- a/include/nfs4.h +++ b/include/nfs4.h @@ -62,6 +62,7 @@ #define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010 #define NFS4_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020 #define NFS4_ACE_IDENTIFIER_GROUP 0x00000040 +#define NFS4_ACE_INHERITED_ACE 0x00000080 #define NFS4_ACE_READ_DATA 0x00000001 #define NFS4_ACE_LIST_DIRECTORY 0x00000001 diff --git a/libnfs4acl/nfs4_ace_from_string.c b/libnfs4acl/nfs4_ace_from_string.c index ab8401ae0629..7f1315434435 100644 --- a/libnfs4acl/nfs4_ace_from_string.c +++ b/libnfs4acl/nfs4_ace_from_string.c @@ -209,6 +209,9 @@ struct nfs4_ace * nfs4_ace_from_string(char *ace_buf, int is_dir) case FLAG_GROUP: flags |= NFS4_ACE_IDENTIFIER_GROUP; break; + case FLAG_INHERITED: + flags |= NFS4_ACE_INHERITED_ACE; + break; default: fprintf(stderr,"Bad Ace Flag:%c\n", *field); goto out_free; diff --git a/libnfs4acl/nfs4_get_ace_flags.c b/libnfs4acl/nfs4_get_ace_flags.c index 1d28ed4b5196..1f27d17ad4cd 100644 --- a/libnfs4acl/nfs4_get_ace_flags.c +++ b/libnfs4acl/nfs4_get_ace_flags.c @@ -53,6 +53,8 @@ char* nfs4_get_ace_flags(struct nfs4_ace *ace, char *buf) *buf++ = FLAG_FAILED_ACCESS;; if (flags & NFS4_ACE_IDENTIFIER_GROUP) *buf++ = FLAG_GROUP; + if (flags & NFS4_ACE_INHERITED_ACE) + *buf++ = FLAG_INHERITED; *buf = '\0'; return bp; diff --git a/nfs4_getfacl/nfs4_getfacl.c b/nfs4_getfacl/nfs4_getfacl.c index e068095b0d6b..1222dd907c9e 100644 --- a/nfs4_getfacl/nfs4_getfacl.c +++ b/nfs4_getfacl/nfs4_getfacl.c @@ -170,6 +170,7 @@ static void more_help() " 'S' successful-access\n" " 'F' failed-access\n" " 'g' group (denotes that is a group)\n" + " 'I' inherited\n" "\n" " * - named user or group, or one of: \"OWNER@\", \"GROUP@\", \"EVERYONE@\"\n" "\n" -- 2.36.1