FreeBSD/sys/security/mac/mac_vfs.c
/*
 * Implementation of VOP_SETLABEL() that relies on extended attributes to
 * store label data.  Can be referenced by filesystems supporting extended
 * attributes.
 */
Implementation of VOP_SETLABEL() that relies on extended attributes to
store label data.  Can be referenced by filesystems supporting extended
attributes.
Implementation of VOP_SETLABEL () that relies on extended attributes to store label data . Can be referenced by filesystems supporting extended attributes .
int
vop_stdsetlabel_ea(struct vop_setlabel_args *ap)
{
	struct vnode *vp = ap->a_vp;
	struct label *intlabel = ap->a_label;
	int error;
	ASSERT_VOP_LOCKED(vp, "vop_stdsetlabel_ea");
	if ((vp->v_mount->mnt_flag & MNT_MULTILABEL) == 0)
		return (EOPNOTSUPP);
	error = mac_vnode_setlabel_extattr(ap->a_cred, vp, intlabel);
	if (error)
		return (error);
	mac_vnode_relabel(ap->a_cred, vp, intlabel);
	return (0);
}
int vop_stdsetlabel_ea ( struct vop_setlabel_args * ap ) { struct vnode * vp = ap -> a_vp ; struct label * intlabel = ap -> a_label ; int error ; ASSERT_VOP_LOCKED ( vp , " " ) ; if ( ( vp -> v_mount -> mnt_flag & MNT_MULTILABEL ) == 0 ) return ( EOPNOTSUPP ) ; error = mac_vnode_setlabel_extattr ( ap -> a_cred , vp , intlabel ) ; if ( error ) return ( error ) ; mac_vnode_relabel ( ap -> a_cred , vp , intlabel ) ; return ( 0 ) ; }
Implementation of VOP_SETLABEL() that relies on extended attributes to
 store label data.
Implementation of VOP_SETLABEL () that relies on extended attributes to store label data .