Fix the experimental nfs subsystem so that it builds with the
current NFSv4 ACLs, as defined in sys/acl.h. It still needs a way to test a mount point for NFSv4 ACL support before it will work. Until then, the NFSHASNFS4ACL() macro just always returns 0. Approved by: kib (mentor)
This commit is contained in:
parent
00a5db46de
commit
c3e22f831f
@ -224,7 +224,7 @@ nfsrv_acemasktoperm(u_int32_t acetype, u_int32_t mask, int owner,
|
||||
}
|
||||
if (mask & NFSV4ACE_SEARCH) {
|
||||
mask &= ~NFSV4ACE_SEARCH;
|
||||
perm |= ACL_SEARCH;
|
||||
perm |= ACL_EXECUTE;
|
||||
}
|
||||
if (mask & NFSV4ACE_DELETECHILD) {
|
||||
mask &= ~NFSV4ACE_DELETECHILD;
|
||||
@ -505,7 +505,7 @@ nfsrv_buildace(struct nfsrv_descript *nd, u_char *name, int namelen,
|
||||
acemask |= NFSV4ACE_READNAMEDATTR;
|
||||
if (ace->ae_perm & ACL_WRITE_NAMED_ATTRS)
|
||||
acemask |= NFSV4ACE_WRITENAMEDATTR;
|
||||
if (ace->ae_perm & ACL_SEARCH)
|
||||
if (ace->ae_perm & ACL_EXECUTE)
|
||||
acemask |= NFSV4ACE_SEARCH;
|
||||
if (ace->ae_perm & ACL_DELETE_CHILD)
|
||||
acemask |= NFSV4ACE_DELETECHILD;
|
||||
|
@ -1018,7 +1018,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
|
||||
if (nfsrv_useacl) {
|
||||
NFSACL_T *naclp;
|
||||
|
||||
naclp = acl_alloc();
|
||||
naclp = acl_alloc(M_WAITOK);
|
||||
error = nfsrv_dissectacl(nd, naclp, &aceerr,
|
||||
&cnt, p);
|
||||
if (error) {
|
||||
@ -1933,7 +1933,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, vnode_t vp, NFSACL_T *saclp,
|
||||
} else {
|
||||
NFSCLRNOTFILLABLE_ATTRBIT(retbitp);
|
||||
#ifdef NFS4_ACL_EXTATTR_NAME
|
||||
naclp = acl_alloc();
|
||||
naclp = acl_alloc(M_WAITOK);
|
||||
#endif
|
||||
aclp = naclp;
|
||||
}
|
||||
|
@ -71,8 +71,6 @@
|
||||
#include <sys/bio.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/acl.h>
|
||||
/* until the nfsv4 acl stuff is all committed, undef NFS4_ACL_EXTATTR_NAME */
|
||||
#undef NFS4_ACL_EXTATTR_NAME
|
||||
#include <sys/module.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/syscall.h>
|
||||
@ -789,7 +787,7 @@ void newnfs_realign(struct mbuf **);
|
||||
#define NFSSETWRITEVERF(n) ((n)->nm_state |= NFSSTA_HASWRITEVERF)
|
||||
#define NFSSETHASSETFSID(n) ((n)->nm_state |= NFSSTA_HASSETFSID)
|
||||
#ifdef NFS4_ACL_EXTATTR_NAME
|
||||
#define NFSHASNFS4ACL(m) ((m)->mnt_flag & MNT_NFS4ACLS)
|
||||
#define NFSHASNFS4ACL(m) 0
|
||||
#else
|
||||
#define NFSHASNFS4ACL(m) 0
|
||||
#endif
|
||||
|
@ -187,7 +187,11 @@ nfsvno_accchk(struct vnode *vp, u_int32_t accessbits, struct ucred *cred,
|
||||
if (vpislocked == 0)
|
||||
NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p);
|
||||
|
||||
#ifdef NFS4_ACL_EXTATTR_NAME
|
||||
#if defined(NFS4_ACL_EXTATTR_NAME) && defined(notyet)
|
||||
/*
|
||||
* This function should be called once FFS has NFSv4 ACL support
|
||||
* in it.
|
||||
*/
|
||||
/*
|
||||
* Should the override still be applied when ACLs are enabled?
|
||||
*/
|
||||
|
@ -237,7 +237,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
return (0);
|
||||
}
|
||||
#ifdef NFS4_ACL_EXTATTR_NAME
|
||||
aclp = acl_alloc();
|
||||
aclp = acl_alloc(M_WAITOK);
|
||||
aclp->acl_cnt = 0;
|
||||
#endif
|
||||
NFSVNO_ATTRINIT(&nva);
|
||||
@ -1041,7 +1041,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
return (0);
|
||||
}
|
||||
#ifdef NFS4_ACL_EXTATTR_NAME
|
||||
aclp = acl_alloc();
|
||||
aclp = acl_alloc(M_WAITOK);
|
||||
aclp->acl_cnt = 0;
|
||||
#endif
|
||||
|
||||
@ -2418,7 +2418,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
NFSACL_T *aclp = NULL;
|
||||
|
||||
#ifdef NFS4_ACL_EXTATTR_NAME
|
||||
aclp = acl_alloc();
|
||||
aclp = acl_alloc(M_WAITOK);
|
||||
aclp->acl_cnt = 0;
|
||||
#endif
|
||||
NFSZERO_ATTRBIT(&attrbits);
|
||||
|
Loading…
x
Reference in New Issue
Block a user