summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2009-10-01 17:22:03 +0000
committertrasz <trasz@FreeBSD.org>2009-10-01 17:22:03 +0000
commitd5661d631d28fee99ac0a8758c56535ac2c9b01b (patch)
treef2b6e2088bb410fc3239074022c9d70c3c255caf /sys/kern/vfs_subr.c
parentc6a1085feffa5fcd9040272aeae30e7f2466f754 (diff)
downloadFreeBSD-src-d5661d631d28fee99ac0a8758c56535ac2c9b01b.zip
FreeBSD-src-d5661d631d28fee99ac0a8758c56535ac2c9b01b.tar.gz
Provide default implementation for VOP_ACCESS(9), so that filesystems which
want to provide VOP_ACCESSX(9) don't have to implement both. Note that this commit makes implementation of either of these two mandatory. Reviewed by: kib
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index c40dad1..d92555f 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -3520,6 +3520,9 @@ vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid,
accmode_t dac_granted;
accmode_t priv_granted;
+ KASSERT((accmode & ~(VEXEC | VWRITE | VREAD | VADMIN | VAPPEND)) == 0,
+ ("invalid bit in accmode"));
+
/*
* Look for a normal, non-privileged way to access the file/directory
* as requested. If it exists, go with that.
OpenPOWER on IntegriCloud