From e54ea574fa306bcc87580c0dc4b763933d819988 Mon Sep 17 00:00:00 2001 From: rwatson Date: Tue, 29 Aug 2000 14:45:49 +0000 Subject: o Restructure vaccess() so as to check for DAC permission to modify the object before falling back on privilege. Make vaccess() accept an additional optional argument, privused, to determine whether privilege was required for vaccess() to return 0. Add commented out capability checks for reference. Rename some variables to make it more clear which modes/uids/etc are associated with the object, and which with the access mode. o Update file system use of vaccess() to pass NULL as the optional privused argument. Once additional patches are applied, suser() will no longer set ASU, so privused will permit passing of privilege information up the stack to the caller. Reviewed by: bde, green, phk, -security, others Obtained from: TrustedBSD Project --- sys/miscfs/kernfs/kernfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/miscfs') diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index 283167a..72b8e78 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -313,7 +313,7 @@ kernfs_access(ap) if ((amode & VWRITE) && (fmode & (S_IWUSR|S_IWGRP|S_IWOTH)) == 0) return (EPERM); - return (vaccess(vp->v_tag, fmode, 0, 0, ap->a_mode, ap->a_cred)); + return (vaccess(vp->v_tag, fmode, 0, 0, ap->a_mode, ap->a_cred, NULL)); } static int -- cgit v1.1