summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflipk <flipk@openbsd.org>1997-03-16 01:18:48 +0000
committerflipk <flipk@openbsd.org>1997-03-16 01:18:48 +0000
commita538e7e97d1b336e22bf8f019ce53d32c8648320 (patch)
tree1ba2469a7166264f2d587b42130c77777a964cc9
parentres_close is defined in a macro and should apperently not be used as _res_close. (diff)
downloadwireguard-openbsd-a538e7e97d1b336e22bf8f019ce53d32c8648320.tar.xz
wireguard-openbsd-a538e7e97d1b336e22bf8f019ce53d32c8648320.zip
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.
-rw-r--r--lib/libc/sys/gettimeofday.24
-rw-r--r--sys/kern/kern_time.c4
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();