From e2ab11b1af2f0f65ebb0f290be8c576ef72efbfb Mon Sep 17 00:00:00 2001 From: Max Laier Date: Sun, 29 Aug 2004 11:51:07 +0000 Subject: MT5: Fix securelevel handling for tables: Loopback a fix from Cedric Berger: Fix table add/replace commands with securelevel=2. Reported by James J. Lippard. and Use securelevel_gt instead of reading global securelevel unprotected. Approved by: re (kensmith) --- sys/contrib/pf/net/pf_ioctl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys') diff --git a/sys/contrib/pf/net/pf_ioctl.c b/sys/contrib/pf/net/pf_ioctl.c index 4df9e375ac9f..a1172c7c211e 100644 --- a/sys/contrib/pf/net/pf_ioctl.c +++ b/sys/contrib/pf/net/pf_ioctl.c @@ -66,6 +66,7 @@ #ifdef __FreeBSD__ #include #include +#include #else #include #include @@ -979,7 +980,11 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct proc *p) int error = 0; /* XXX keep in sync with switch() below */ +#ifdef __FreeBSD__ + if (securelevel_gt(td->td_ucred, 1)) +#else if (securelevel > 1) +#endif switch (cmd) { case DIOCGETRULES: case DIOCGETRULE: -- cgit v1.3