From: trondmy@kernel.org
To: Steve Dickson <SteveD@redhat.com>,
"J.Bruce Fields" <bfields@fieldses.org>
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 [thread overview]
Message-ID: <20220514144436.4298-3-trondmy@kernel.org> (raw)
In-Reply-To: <20220514144436.4298-2-trondmy@kernel.org>
From: Trond Myklebust <trond.myklebust@hammerspace.com>
Use the letter 'I' to represent an inherited ACE.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
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 <principal> is a group)\n"
+ " 'I' inherited\n"
"\n"
" * <principal> - named user or group, or one of: \"OWNER@\", \"GROUP@\", \"EVERYONE@\"\n"
"\n"
--
2.36.1
next prev parent reply other threads:[~2022-05-14 14:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-14 14:44 [PATCH 0/6] Allow nfs4-acl-tools to access 'dacl' and 'sacl' trondmy
2022-05-14 14:44 ` [PATCH 1/6] libnfs4acl: Add helpers to set the dacl and sacl trondmy
2022-05-14 14:44 ` trondmy [this message]
2022-05-14 14:44 ` [PATCH 3/6] The NFSv41 DACL and SACL prepend an extra field to the acl trondmy
2022-05-14 14:44 ` [PATCH 4/6] nfs4_getacl: Add support for the --dacl and --sacl options trondmy
2022-05-14 14:44 ` [PATCH 5/6] nfs4_setacl: " trondmy
2022-05-14 14:44 ` [PATCH 6/6] Edit manpages to document the new --dacl, --sacl and inheritance features trondmy
2022-05-15 1:59 ` [PATCH 0/6] Allow nfs4-acl-tools to access 'dacl' and 'sacl' J.Bruce Fields
2022-05-15 3:23 ` Trond Myklebust
2022-05-19 13:47 ` Steve Dickson
2022-05-19 13:53 ` bfields
2022-05-19 18:52 ` Steve Dickson
2022-05-19 19:01 ` bfields
2022-06-21 13:43 ` Steve Dickson
2022-06-21 13:58 ` J.Bruce Fields
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=20220514144436.4298-3-trondmy@kernel.org \
--to=trondmy@kernel.org \
--cc=SteveD@redhat.com \
--cc=bfields@fieldses.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).