git: 5da9b3b011fd - main - Revert "nfscommon: Add arguments for support of the dacl attribute"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 11 Jan 2022 16:34:32 UTC
The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5da9b3b011fd74745a6b1d87329144d7d5d234dd commit 5da9b3b011fd74745a6b1d87329144d7d5d234dd Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2022-01-11 16:30:50 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2022-01-11 16:30:50 +0000 Revert "nfscommon: Add arguments for support of the dacl attribute" This reverts commit 0fa074b53e7c22157dcb41aaa25a33abc8118f26. I now see that the implementation of the "dacl" operation requires that the NFSv4 server to "automatic inheritance" and I do not plan on doing this. As such, this patch is harmless, but unneeded. --- sys/fs/nfs/nfs_commonacl.c | 16 +++++----------- sys/fs/nfs/nfs_commonsubs.c | 25 ++++++++++++------------- sys/fs/nfs/nfs_var.h | 6 +++--- sys/fs/nfs/nfsproto.h | 1 - sys/fs/nfsclient/nfs_clrpcops.c | 16 ++++++++-------- sys/fs/nfsserver/nfs_nfsdport.c | 4 ++-- 6 files changed, 30 insertions(+), 38 deletions(-) diff --git a/sys/fs/nfs/nfs_commonacl.c b/sys/fs/nfs/nfs_commonacl.c index e3583b273db8..19492675e731 100644 --- a/sys/fs/nfs/nfs_commonacl.c +++ b/sys/fs/nfs/nfs_commonacl.c @@ -42,7 +42,7 @@ static int nfsrv_acemasktoperm(u_int32_t acetype, u_int32_t mask, int owner, */ int nfsrv_dissectace(struct nfsrv_descript *nd, struct acl_entry *acep, - bool dacl, int *aceerrp, int *acesizep, NFSPROC_T *p) + int *aceerrp, int *acesizep, NFSPROC_T *p) { u_int32_t *tl; int len, gotid = 0, owner = 0, error = 0, aceerr = 0; @@ -147,10 +147,6 @@ nfsrv_dissectace(struct nfsrv_descript *nd, struct acl_entry *acep, flag &= ~NFSV4ACE_FAILEDACCESS; acep->ae_flags |= ACL_ENTRY_FAILED_ACCESS; } - if (dacl && (flag & NFSV4ACE_INHERITED)) { - flag &= ~NFSV4ACE_INHERITED; - acep->ae_flags |= ACL_ENTRY_INHERITED; - } /* * Set ae_entry_type. */ @@ -282,14 +278,14 @@ out: /* local functions */ static int nfsrv_buildace(struct nfsrv_descript *, u_char *, int, - enum vtype, int, int, bool, struct acl_entry *); + enum vtype, int, int, struct acl_entry *); /* * This function builds an NFS ace. */ static int nfsrv_buildace(struct nfsrv_descript *nd, u_char *name, int namelen, - enum vtype type, int group, int owner, bool dacl, struct acl_entry *ace) + enum vtype type, int group, int owner, struct acl_entry *ace) { u_int32_t *tl, aceflag = 0x0, acemask = 0x0, acetype; int full_len; @@ -325,8 +321,6 @@ nfsrv_buildace(struct nfsrv_descript *nd, u_char *name, int namelen, aceflag |= NFSV4ACE_SUCCESSFULACCESS; if (ace->ae_flags & ACL_ENTRY_FAILED_ACCESS) aceflag |= NFSV4ACE_FAILEDACCESS; - if (dacl && (ace->ae_flags & ACL_ENTRY_INHERITED)) - aceflag |= NFSV4ACE_INHERITED; if (group) aceflag |= NFSV4ACE_IDENTIFIERGROUP; *tl++ = txdr_unsigned(aceflag); @@ -400,7 +394,7 @@ nfsrv_buildace(struct nfsrv_descript *nd, u_char *name, int namelen, */ int nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *aclp, enum vtype type, - bool dacl, NFSPROC_T *p) + NFSPROC_T *p) { int i, entrycnt = 0, retlen; u_int32_t *entrycntp; @@ -448,7 +442,7 @@ nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *aclp, enum vtype type, continue; } retlen += nfsrv_buildace(nd, name, namelen, type, isgroup, - isowner, dacl, &aclp->acl_entry[i]); + isowner, &aclp->acl_entry[i]); entrycnt++; if (malloced) free(name, M_NFSSTRING); diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index cdf3f4830e31..8bfe031f01ab 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -1090,8 +1090,8 @@ nfsmout: * If the aclp == NULL or won't fit in an acl, just discard the acl info. */ int -nfsrv_dissectacl(struct nfsrv_descript *nd, NFSACL_T *aclp, bool dacl, - int *aclerrp, int *aclsizep, __unused NFSPROC_T *p) +nfsrv_dissectacl(struct nfsrv_descript *nd, NFSACL_T *aclp, int *aclerrp, + int *aclsizep, __unused NFSPROC_T *p) { u_int32_t *tl; int i, aclsize; @@ -1122,7 +1122,7 @@ nfsrv_dissectacl(struct nfsrv_descript *nd, NFSACL_T *aclp, bool dacl, for (i = 0; i < acecnt; i++) { if (aclp && !aceerr) error = nfsrv_dissectace(nd, &aclp->acl_entry[i], - dacl, &aceerr, &acesize, p); + &aceerr, &acesize, p); else error = nfsrv_skipace(nd, &acesize); if (error) @@ -1487,8 +1487,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, NFSACL_T *naclp; naclp = acl_alloc(M_WAITOK); - error = nfsrv_dissectacl(nd, naclp, false, - &aceerr, &cnt, p); + error = nfsrv_dissectacl(nd, naclp, &aceerr, + &cnt, p); if (error) { acl_free(naclp); goto nfsmout; @@ -1498,8 +1498,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, *retcmpp = NFSERR_NOTSAME; acl_free(naclp); } else { - error = nfsrv_dissectacl(nd, NULL, false, - &aceerr, &cnt, p); + error = nfsrv_dissectacl(nd, NULL, &aceerr, + &cnt, p); if (error) goto nfsmout; *retcmpp = NFSERR_ATTRNOTSUPP; @@ -1507,11 +1507,11 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, } } else { if (vp != NULL && aclp != NULL) - error = nfsrv_dissectacl(nd, aclp, false, - &aceerr, &cnt, p); + error = nfsrv_dissectacl(nd, aclp, &aceerr, + &cnt, p); else - error = nfsrv_dissectacl(nd, NULL, false, - &aceerr, &cnt, p); + error = nfsrv_dissectacl(nd, NULL, &aceerr, + &cnt, p); if (error) goto nfsmout; } @@ -2690,8 +2690,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, * Recommended Attributes. (Only the supported ones.) */ case NFSATTRBIT_ACL: - retnum += nfsrv_buildacl(nd, aclp, vnode_vtype(vp), - false, p); + retnum += nfsrv_buildacl(nd, aclp, vnode_vtype(vp), p); break; case NFSATTRBIT_ACLSUPPORT: NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index d41c1853cb1f..860b7b7ccfc3 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -331,7 +331,7 @@ int nfsm_advance(struct nfsrv_descript *, int, int); void *nfsm_dissct(struct nfsrv_descript *, int, int); void newnfs_copycred(struct nfscred *, struct ucred *); void newnfs_copyincred(struct ucred *, struct nfscred *); -int nfsrv_dissectacl(struct nfsrv_descript *, NFSACL_T *, bool, int *, +int nfsrv_dissectacl(struct nfsrv_descript *, NFSACL_T *, int *, int *, NFSPROC_T *); int nfsrv_getattrbits(struct nfsrv_descript *, nfsattrbit_t *, int *, int *); @@ -435,9 +435,9 @@ int nfs_supportsnfsv4acls(vnode_t); /* nfs_commonacl.c */ int nfsrv_dissectace(struct nfsrv_descript *, struct acl_entry *, - bool, int *, int *, NFSPROC_T *); + int *, int *, NFSPROC_T *); int nfsrv_buildacl(struct nfsrv_descript *, NFSACL_T *, enum vtype, - bool, NFSPROC_T *); + NFSPROC_T *); int nfsrv_compareacl(NFSACL_T *, NFSACL_T *); /* nfs_clrpcops.c */ diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index b1b624e824c2..968cc6a41cc3 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -508,7 +508,6 @@ #define NFSV4ACE_SUCCESSFULACCESS 0x00000010 #define NFSV4ACE_FAILEDACCESS 0x00000020 #define NFSV4ACE_IDENTIFIERGROUP 0x00000040 -#define NFSV4ACE_INHERITED 0x00000080 #define NFSV4ACE_READDATA 0x00000001 #define NFSV4ACE_LISTDIRECTORY 0x00000001 diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 8886ccc8429e..e7558b85a46f 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -621,8 +621,8 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, } if (ret) ndp->nfsdl_flags |= NFSCLDL_RECALL; - error = nfsrv_dissectace(nd, &ndp->nfsdl_ace, false, - &ret, &acesize, p); + error = nfsrv_dissectace(nd, &ndp->nfsdl_ace, &ret, + &acesize, p); if (error) goto nfsmout; } else if (deleg != NFSV4OPEN_DELEGATENONE) { @@ -2567,8 +2567,8 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap, } if (ret) dp->nfsdl_flags |= NFSCLDL_RECALL; - error = nfsrv_dissectace(nd, &dp->nfsdl_ace, false, - &ret, &acesize, p); + error = nfsrv_dissectace(nd, &dp->nfsdl_ace, &ret, + &acesize, p); if (error) goto nfsmout; } else if (deleg != NFSV4OPEN_DELEGATENONE) { @@ -8005,8 +8005,8 @@ nfsrpc_openlayoutrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, ndp->nfsdl_flags = NFSCLDL_READ; if (ret != 0) ndp->nfsdl_flags |= NFSCLDL_RECALL; - error = nfsrv_dissectace(nd, &ndp->nfsdl_ace, false, - &ret, &acesize, p); + error = nfsrv_dissectace(nd, &ndp->nfsdl_ace, &ret, + &acesize, p); if (error != 0) goto nfsmout; } else if (deleg != NFSV4OPEN_DELEGATENONE) { @@ -8216,8 +8216,8 @@ nfsrpc_createlayout(vnode_t dvp, char *name, int namelen, struct vattr *vap, } if (ret != 0) dp->nfsdl_flags |= NFSCLDL_RECALL; - error = nfsrv_dissectace(nd, &dp->nfsdl_ace, false, - &ret, &acesize, p); + error = nfsrv_dissectace(nd, &dp->nfsdl_ace, &ret, + &acesize, p); if (error != 0) goto nfsmout; } else if (deleg != NFSV4OPEN_DELEGATENONE) { diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 6f9e1326928e..1a72251530dd 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2992,8 +2992,8 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nvap, attrsum += NFSX_HYPER; break; case NFSATTRBIT_ACL: - error = nfsrv_dissectacl(nd, aclp, false, &aceerr, - &aclsize, p); + error = nfsrv_dissectacl(nd, aclp, &aceerr, &aclsize, + p); if (error) goto nfsmout; if (aceerr && !nd->nd_repstat)