From a538e7e97d1b336e22bf8f019ce53d32c8648320 Mon Sep 17 00:00:00 2001 From: flipk Date: Sun, 16 Mar 1997 01:18:48 +0000 Subject: [PATCH] allow settimeofday() at securelevel < 2, rather than < 1. the consensus was that it was too annoying to not be able to change the clock at securelevel == 1. --- lib/libc/sys/gettimeofday.2 | 4 ++-- sys/kern/kern_time.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2 index b8348fa1b3f..febc61dcdba 100644 --- a/lib/libc/sys/gettimeofday.2 +++ b/lib/libc/sys/gettimeofday.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: gettimeofday.2,v 1.4 1997/02/22 08:32:52 millert Exp $ +.\" $OpenBSD: gettimeofday.2,v 1.5 1997/03/16 01:18:49 flipk Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -96,7 +96,7 @@ Daylight Saving time applies locally during the appropriate part of the year. .Pp Only the super-user may set the time of day or time zone. -If the system is running in secure mode (see +If the system securelevel is greater than 1 (see .Xr init 8 ), the time may only be advanced. This limitation is imposed to prevent a malicious super-user diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 4a3454007a6..c6b5ebfcdec 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_time.c,v 1.4 1997/02/22 08:28:28 millert Exp $ */ +/* $OpenBSD: kern_time.c,v 1.5 1997/03/16 01:18:48 flipk Exp $ */ /* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */ /* @@ -122,7 +122,7 @@ sys_settimeofday(p, v, retval) * but not set back). This feature prevent interlopers from * setting arbitrary time stamps on files. */ - if (securelevel > 0 && timercmp(&atv, &time, <)) + if (securelevel > 1 && timercmp(&atv, &time, <)) return (EPERM); /* WHAT DO WE DO ABOUT PENDING REAL-TIME TIMEOUTS??? */ s = splclock(); -- 2.20.1