aboutsummaryrefslogtreecommitdiff
path: root/sys/security/mac/mac_framework.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/security/mac/mac_framework.h')
-rw-r--r--sys/security/mac/mac_framework.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/security/mac/mac_framework.h b/sys/security/mac/mac_framework.h
index ea061d6258ff..481f90a04801 100644
--- a/sys/security/mac/mac_framework.h
+++ b/sys/security/mac/mac_framework.h
@@ -538,7 +538,22 @@ mac_vnode_check_poll(struct ucred *active_cred, struct ucred *file_cred,
}
#endif
int mac_vnode_check_readdir(struct ucred *cred, struct vnode *vp);
-int mac_vnode_check_readlink(struct ucred *cred, struct vnode *vp);
+int mac_vnode_check_readlink_impl(struct ucred *cred, struct vnode *dvp);
+#ifdef MAC
+extern bool mac_vnode_check_readlink_fp_flag;
+#else
+#define mac_vnode_check_readlink_fp_flag 0
+#endif
+#define mac_vnode_check_readlink_enabled() __predict_false(mac_vnode_check_readlink_fp_flag)
+static inline int
+mac_vnode_check_readlink(struct ucred *cred, struct vnode *vp)
+{
+
+ mac_vnode_assert_locked(vp, "mac_vnode_check_readlink");
+ if (mac_vnode_check_readlink_enabled())
+ return (mac_vnode_check_readlink_impl(cred, vp));
+ return (0);
+}
#define mac_vnode_check_rename_from_enabled() __predict_false(mac_vnode_check_rename_from_fp_flag)
#ifdef MAC
extern bool mac_vnode_check_rename_from_fp_flag;