From 02b65ffb648814e70a3023eb49fdce1da15b66e7 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Tue, 23 Jan 2001 04:15:19 +0000 Subject: o The move to using VADMIN under vaccess() resulted in some system calls returning EACCES instead of EPERM. This patch modifies vaccess() to return EPERM instead of EACCES if VADMIN is among the requested rights. This affects functions normally limited to the owners of a file, such as chmod(), as EPERM is the error indicating that privilege would allow the operation, rather than a chance in mandatory or discretionary rights. Reported by: bde --- sys/kern/vfs_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/kern/vfs_subr.c') diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 285e084e7c12..fba809c63aaf 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3128,5 +3128,5 @@ privcheck: } #endif - return (EACCES); + return ((acc_mode & VADMIN) ? EPERM : EACCES); } -- cgit v1.2.3