Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Added clockctl(4)



details:   https://anonhg.NetBSD.org/src/rev/f01ea370debd
branches:  trunk
changeset: 516289:f01ea370debd
user:      manu <manu%NetBSD.org@localhost>
date:      Sat Oct 20 09:10:33 2001 +0000

description:
Added clockctl(4)

diffstat:

 distrib/sets/lists/man/mi |    3 +-
 share/man/man4/clockctl.4 |  129 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 131 insertions(+), 1 deletions(-)

diffs (150 lines):

diff -r 1cc720485bac -r f01ea370debd distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Sat Oct 20 08:32:24 2001 +0000
+++ b/distrib/sets/lists/man/mi Sat Oct 20 09:10:33 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.413 2001/10/20 06:13:28 jmc Exp $
+# $NetBSD: mi,v 1.414 2001/10/20 09:10:34 manu Exp $
 ./usr/share/info/am-utils.info                 man-amd-info
 ./usr/share/info/as.info                       man-computil-info
 ./usr/share/info/awk.info                      man-util-info
@@ -2188,6 +2188,7 @@
 ./usr/share/man/man4/clcs.4                    man-sys-man
 ./usr/share/man/man4/clct.4                    man-sys-man
 ./usr/share/man/man4/clnp.4                    man-sys-man
+./usr/share/man/man4/clockctl.4                        man-sys-man
 ./usr/share/man/man4/cltp.4                    man-sys-man
 ./usr/share/man/man4/cmpci.4                   man-sys-man
 ./usr/share/man/man4/cms.4                     man-sys-man
diff -r 1cc720485bac -r f01ea370debd share/man/man4/clockctl.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/clockctl.4 Sat Oct 20 09:10:33 2001 +0000
@@ -0,0 +1,129 @@
+.\"    $NetBSD: clockctl.4,v 1.1 2001/10/20 09:10:33 manu Exp $
+.\"
+.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Emmanuel Dreyfus.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"        This product includes software developed by the NetBSD
+.\"        Foundation, Inc. and its contributors.
+.\" 4. Neither the name of The NetBSD Foundation nor the names of its
+.\"    contributors may be used to endorse or promote products derived
+.\"    from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd Octobrer 20, 2001
+.Dt CLOCKCTL 4
+.Os
+.Sh NAME
+.Nm clockctl
+.Nd Clock subsystem user control
+.Sh SYNOPSIS
+.Cd pseudo-device clockctl
+.Sh DESCRIPTION
+The 
+.Nm 
+interface brings clock control to non root users. Any user with write access
+to 
+.Pa /dev/clockctl
+will be able to perform operations such as 
+.Xr settimeofday 2 ,
+.Xr clock_settime 2 ,
+.Xr adjtime 2 ,
+or
+.Xr ntp_adjtime 2 ,
+which are normally restricted to the super-user. Using the
+.Nm 
+pseudodevice, it is possible to run daemons such as
+.Xr ntpd 8
+as a non privilegied user, thus lowereing the security implications if an 
+exploit is found in this daemon.
+.Pp
+The
+.Nm
+pseudodevice driver provides an
+.Xr ioctl 2
+call for each of the privilegied clock-related system calls. The system 
+call stubs in libc will use the 
+.Xr ioctl 2
+on 
+.Pa /dev/clockctl
+if the special file is present and accessible, or it will revert to the 
+plain super-user restricted system call if it is not accessible.
+.Pp
+The following 
+.Xr ioctl 2
+calls are defined in 
+.Aq Pa sys/clockctl.h Ns :
+.Bl -tag -width CLOCKCTL
+.It Dv CLOCKCTL_SETTIMEOFDAY
+This will run the 
+.Xr settimeofday 2
+system call. Argument should be a pointer to a 
+.Va struct clockctl_settimeofday_args :
+.Bd -literal
+struct clockctl_settimeofday_args {
+    struct timeval tv;
+    struct timezone tzp;
+};
+.Ed
+.It Dv CLOCKCTL_CLOCK_SETTIME
+This will run the
+.Xr clock_settime 2
+system call. Argument should be a pointer to a
+.Va struct clockctl_clock_settime_args :
+.Bd -literal
+struct clockctl_clock_settime_args {
+    clockid_t clock_id;
+    struct timespec tp;
+};
+.Ed
+.It Dv CLOCKCTL_ADJTIME
+This will run the
+.Xr adjtime 2
+system call. Argument should be a pointer to a
+.Va struct clockctl_adjtime_args :
+.Bd -literal
+struct clockctl_adjtime_args {
+    struct timeval delta;
+    struct timeval olddelta;
+};
+.Ed
+.It Dv CLOCKCTL_NTP_ADJTIME
+This will run the
+.Xr ntp_adjtime 2      
+system call. Argument should be a pointer to a
+.Va struct clockctl_ntp_adjtime_args :      
+.Bd -literal
+struct clockctl_ntp_adjtime_args {
+    struct timex tp;
+};
+.Ed
+.El
+.Sh SEE ALSO
+.Xr settimeofday 2 ,
+.Xr clock_settime 2 ,
+.Xr adjtime 2 ,
+.Xr ioctl 2 .



Home | Main Index | Thread Index | Old Index