From 55db18b28ad67a780ecf487d007fe2e2ab9bb5b7 Mon Sep 17 00:00:00 2001 From: dm Date: Tue, 23 Apr 1996 15:03:52 +0000 Subject: [PATCH] Allow the security level to be lowered when in security level 0 --- sys/kern/kern_sysctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index f46b360b905..1902a35e381 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.5 1996/04/21 22:27:10 deraadt Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.6 1996/04/23 15:03:52 dm Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.16 1996/04/12 23:21:37 thorpej Exp $ */ /*- @@ -233,7 +233,8 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) if ((error = sysctl_int(oldp, oldlenp, newp, newlen, &level)) || newp == NULL) return (error); - if (level < securelevel && p->p_pid != 1) + if ((securelevel > 0 || level < -1) + && level < securelevel && p->p_pid != 1) return (EPERM); securelevel = level; return (0); -- 2.20.1