summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 7b8643f011a..4e888b98f27 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.283 2018/12/07 16:21:19 mpi Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.284 2018/12/23 10:46:51 natano Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1611,6 +1611,15 @@ vaccess(enum vtype type, mode_t file_mode, uid_t uid, gid_t gid,
return (file_mode & mask) == mask ? 0 : EACCES;
}
+int
+vnoperm(struct vnode *vp)
+{
+ if (vp->v_flag & VROOT || vp->v_mount == NULL)
+ return 0;
+
+ return (vp->v_mount->mnt_flag & MNT_NOPERM);
+}
+
struct rwlock vfs_stall_lock = RWLOCK_INITIALIZER("vfs_stall");
int