From e0c12d4c231f5a10deac1224ed3abcb9d4d459a4 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sun, 20 Oct 2002 21:49:41 +0000 Subject: [PATCH] Teach UFS to respond to pathconf() tests for _POSIX_ACL_EXTENDED and _POSIX_MAC_PRESENT based on available mount flags, if the services are available. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories --- sys/ufs/ufs/ufs_vnops.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 47f392a8879b..2aad545a4719 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2188,6 +2188,26 @@ ufs_pathconf(ap) case _PC_NO_TRUNC: *ap->a_retval = 1; return (0); + case _POSIX_ACL_EXTENDED: +#ifdef UFS_ACL + if (ap->a_vp->v_mount->mnt_flag & MNT_ACLS) + *ap->a_retval = 1; + else + *ap->a_retval = 0; +#else + *ap->a_retval = 0; +#endif + return (0); + case _POSIX_MAC_PRESENT: +#ifdef MAC + if (ap->a_vp->v_mount->mnt_flag & MNT_MULTILABEL) + *ap->a_retval = 1; + else + *ap->a_retval = 0; +#else + *ap->a_retval = 0; +#endif + return (0); default: return (EINVAL); }