FreeBSD/sys/ufs/ufs/ufs_acl.c
/*
 * Retrieve NFSv4 ACL, skipping access checks.  Must be used in UFS code
 * instead of VOP_GETACL() when we don't want to be restricted by the user
 * not having ACL_READ_ACL permission, e.g. when calculating inherited ACL
 * or in ufs_vnops.c:ufs_accessx().
 */
Retrieve NFSv4 ACL, skipping access checks.  Must be used in UFS code
instead of VOP_GETACL() when we don't want to be restricted by the user
not having ACL_READ_ACL permission, e.g. when calculating inherited ACL
or in ufs_vnops.c:ufs_accessx().
Retrieve NFSv4 ACL skipping access checks . Must be used in UFS code instead of VOP_GETACL () when we don ' t want to be restricted by the user not having ACL_READ_ACL permission e . g . when calculating inherited ACL or in ufs_vnops . c : ufs_accessx () .
int
ufs_getacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td)
{
	int error, len;
	struct inode *ip = VTOI(vp);
	len = sizeof(*aclp);
	bzero(aclp, len);
	error = vn_extattr_get(vp, IO_NODELOCKED,
	    NFS4_ACL_EXTATTR_NAMESPACE, NFS4_ACL_EXTATTR_NAME,
	    &len, (char *) aclp, td);
	aclp->acl_maxcnt = ACL_MAX_ENTRIES;
	if (error == ENOATTR) {
		acl_nfs4_sync_acl_from_mode(aclp, ip->i_mode, ip->i_uid);
		return (0);
	}
	if (error)
		return (error);
	if (len != sizeof(*aclp)) {
		printf("ufs_getacl_nfs4(): Loaded invalid ACL ("
		    "%d bytes), inumber %ju on %s\n", len,
		    (uintmax_t)ip->i_number, ip->i_fs->fs_fsmnt);
		return (EPERM);
	}
	error = acl_nfs4_check(aclp, vp->v_type == VDIR);
	if (error) {
		printf("ufs_getacl_nfs4(): Loaded invalid ACL "
		    "(failed acl_nfs4_check), inumber %ju on %s\n",
		    (uintmax_t)ip->i_number, ip->i_fs->fs_fsmnt);
		return (EPERM);
	}
	return (0);
}
int ufs_getacl_nfs4_internal ( struct vnode * vp , struct acl * aclp , struct thread * td ) { int error , len ; struct inode * ip = VTOI ( vp ) ; len = sizeof ( * aclp ) ; bzero ( aclp , len ) ; error = vn_extattr_get ( vp , IO_NODELOCKED , NFS4_ACL_EXTATTR_NAMESPACE , NFS4_ACL_EXTATTR_NAME , & len , ( char * ) aclp , td ) ; aclp -> acl_maxcnt = ACL_MAX_ENTRIES ; if ( error == ENOATTR ) { acl_nfs4_sync_acl_from_mode ( aclp , ip -> i_mode , ip -> i_uid ) ; return ( 0 ) ; } if ( error ) return ( error ) ; if ( len != sizeof ( * aclp ) ) { printf ( " " " \n " , len , ( uintmax_t ) ip -> i_number , ip -> i_fs -> fs_fsmnt ) ; return ( EPERM ) ; } error = acl_nfs4_check ( aclp , vp -> v_type == VDIR ) ; if ( error ) { printf ( " " " \n " , ( uintmax_t ) ip -> i_number , ip -> i_fs -> fs_fsmnt ) ; return ( EPERM ) ; } return ( 0 ) ; }
Retrieve NFSv4 ACL, skipping access checks.
Retrieve NFSv4 ACL skipping access checks .
/*
		 * Legitimately no ACL set on object, purely
		 * emulate it through the inode.
		 */ /*
		 * A short (or long) read, meaning that for
		 * some reason the ACL is corrupted.  Return
		 * EPERM since the object DAC protections
		 * are unsafe.
		 */