Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfs/nfs_commonacl.c
Show All 34 Lines | |||||
extern int nfsrv_useacl; | extern int nfsrv_useacl; | ||||
static int nfsrv_acemasktoperm(u_int32_t acetype, u_int32_t mask, int owner, | static int nfsrv_acemasktoperm(u_int32_t acetype, u_int32_t mask, int owner, | ||||
enum vtype type, acl_perm_t *permp); | enum vtype type, acl_perm_t *permp); | ||||
/* | /* | ||||
* Handle xdr for an ace. | * Handle xdr for an ace. | ||||
*/ | */ | ||||
APPLESTATIC int | int | ||||
nfsrv_dissectace(struct nfsrv_descript *nd, struct acl_entry *acep, | nfsrv_dissectace(struct nfsrv_descript *nd, struct acl_entry *acep, | ||||
int *aceerrp, int *acesizep, NFSPROC_T *p) | int *aceerrp, int *acesizep, NFSPROC_T *p) | ||||
{ | { | ||||
u_int32_t *tl; | u_int32_t *tl; | ||||
int len, gotid = 0, owner = 0, error = 0, aceerr = 0; | int len, gotid = 0, owner = 0, error = 0, aceerr = 0; | ||||
u_char *name, namestr[NFSV4_SMALLSTR + 1]; | u_char *name, namestr[NFSV4_SMALLSTR + 1]; | ||||
u_int32_t flag, mask, acetype; | u_int32_t flag, mask, acetype; | ||||
gid_t gid; | gid_t gid; | ||||
▲ Show 20 Lines • Show All 331 Lines • ▼ Show 20 Lines | if (full_len - namelen) | ||||
*(tl + (namelen / NFSX_UNSIGNED)) = 0x0; | *(tl + (namelen / NFSX_UNSIGNED)) = 0x0; | ||||
NFSBCOPY(name, (caddr_t)tl, namelen); | NFSBCOPY(name, (caddr_t)tl, namelen); | ||||
return (full_len + 4 * NFSX_UNSIGNED); | return (full_len + 4 * NFSX_UNSIGNED); | ||||
} | } | ||||
/* | /* | ||||
* Build an NFSv4 ACL. | * Build an NFSv4 ACL. | ||||
*/ | */ | ||||
APPLESTATIC int | int | ||||
nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *aclp, enum vtype type, | nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *aclp, enum vtype type, | ||||
NFSPROC_T *p) | NFSPROC_T *p) | ||||
{ | { | ||||
int i, entrycnt = 0, retlen; | int i, entrycnt = 0, retlen; | ||||
u_int32_t *entrycntp; | u_int32_t *entrycntp; | ||||
int isowner, isgroup, namelen, malloced; | int isowner, isgroup, namelen, malloced; | ||||
u_char *name, namestr[NFSV4_SMALLSTR]; | u_char *name, namestr[NFSV4_SMALLSTR]; | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *aclp, enum vtype type, | ||||
*entrycntp = txdr_unsigned(entrycnt); | *entrycntp = txdr_unsigned(entrycnt); | ||||
return (retlen); | return (retlen); | ||||
} | } | ||||
/* | /* | ||||
* Compare two NFSv4 acls. | * Compare two NFSv4 acls. | ||||
* Return 0 if they are the same, 1 if not the same. | * Return 0 if they are the same, 1 if not the same. | ||||
*/ | */ | ||||
APPLESTATIC int | int | ||||
nfsrv_compareacl(NFSACL_T *aclp1, NFSACL_T *aclp2) | nfsrv_compareacl(NFSACL_T *aclp1, NFSACL_T *aclp2) | ||||
{ | { | ||||
int i; | int i; | ||||
struct acl_entry *acep1, *acep2; | struct acl_entry *acep1, *acep2; | ||||
if (aclp1->acl_cnt != aclp2->acl_cnt) | if (aclp1->acl_cnt != aclp2->acl_cnt) | ||||
return (1); | return (1); | ||||
acep1 = aclp1->acl_entry; | acep1 = aclp1->acl_entry; | ||||
Show All 21 Lines |