From 7ee76f9d4e412bec836c40950dbcb18b02006aa6 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Tue, 20 Feb 2007 23:49:31 +0000 Subject: [PATCH] Remove unnecessary privilege and privilege check for WITNESS sysctl. Head nod: jhb --- sys/kern/subr_witness.c | 6 ------ sys/sys/priv.h | 19 +++++++++---------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 106b0985625..7596a042366 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -539,12 +539,6 @@ sysctl_debug_witness_watch(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &value, 0, req); if (error != 0 || req->newptr == NULL) return (error); - /* - * XXXRW: Why a priv check here? - */ - error = priv_check(req->td, PRIV_WITNESS); - if (error != 0) - return (error); if (value == witness_watch) return (0); if (value != 0) diff --git a/sys/sys/priv.h b/sys/sys/priv.h index 138482eafc4..165bf9ead1f 100644 --- a/sys/sys/priv.h +++ b/sys/sys/priv.h @@ -77,16 +77,15 @@ #define PRIV_SWAPON 9 /* Can swapon(). */ #define PRIV_SWAPOFF 10 /* Can swapoff(). */ #define PRIV_MSGBUF 11 /* Can read kernel message buffer. */ -#define PRIV_WITNESS 12 /* Can configure WITNESS. */ -#define PRIV_IO 13 /* Can perform low-level I/O. */ -#define PRIV_KEYBOARD 14 /* Reprogram keyboard. */ -#define PRIV_DRIVER 15 /* Low-level driver privilege. */ -#define PRIV_ADJTIME 16 /* Set time adjustment. */ -#define PRIV_NTP_ADJTIME 17 /* Set NTP time adjustment. */ -#define PRIV_CLOCK_SETTIME 18 /* Can call clock_settime. */ -#define PRIV_SETTIMEOFDAY 19 /* Can call settimeofday. */ -#define PRIV_SETHOSTID 20 /* Can call sethostid. */ -#define PRIV_SETDOMAINNAME 21 /* Can call setdomainname. */ +#define PRIV_IO 12 /* Can perform low-level I/O. */ +#define PRIV_KEYBOARD 13 /* Reprogram keyboard. */ +#define PRIV_DRIVER 14 /* Low-level driver privilege. */ +#define PRIV_ADJTIME 15 /* Set time adjustment. */ +#define PRIV_NTP_ADJTIME 16 /* Set NTP time adjustment. */ +#define PRIV_CLOCK_SETTIME 17 /* Can call clock_settime. */ +#define PRIV_SETTIMEOFDAY 18 /* Can call settimeofday. */ +#define PRIV_SETHOSTID 19 /* Can call sethostid. */ +#define PRIV_SETDOMAINNAME 20 /* Can call setdomainname. */ /* * Audit subsystem privileges.