-/* $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 $ */
/*-
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);