Wed Sep 30 04:30:50 2009 UTC ()
Remove stale references to the "read only at securelevel [12]" flags in
the documentation and code comments.


(elad)
diff -r1.160 -r1.161 src/sbin/sysctl/sysctl.8
diff -r1.129 -r1.130 src/sbin/sysctl/sysctl.c

cvs diff -r1.160 -r1.161 src/sbin/sysctl/sysctl.8 (expand / switch to unified diff)

--- src/sbin/sysctl/sysctl.8 2009/04/01 15:55:27 1.160
+++ src/sbin/sysctl/sysctl.8 2009/09/30 04:30:50 1.161
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sysctl.8,v 1.160 2009/04/01 15:55:27 christos Exp $ 1.\" $NetBSD: sysctl.8,v 1.161 2009/09/30 04:30:50 elad Exp $
2.\" 2.\"
3.\" Copyright (c) 2004 The NetBSD Foundation, Inc. 3.\" Copyright (c) 2004 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 14.\"
@@ -44,27 +44,27 @@ @@ -44,27 +44,27 @@
44.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 44.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 45.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
46.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 46.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
47.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 47.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
48.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 48.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
49.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 49.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 50.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 51.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 52.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53.\" SUCH DAMAGE. 53.\" SUCH DAMAGE.
54.\" 54.\"
55.\" @(#)sysctl.8 8.1 (Berkeley) 6/6/93 55.\" @(#)sysctl.8 8.1 (Berkeley) 6/6/93
56.\" 56.\"
57.Dd April 1, 2009 57.Dd September 30, 2009
58.Dt SYSCTL 8 58.Dt SYSCTL 8
59.Os 59.Os
60.Sh NAME 60.Sh NAME
61.Nm sysctl 61.Nm sysctl
62.Nd get or set kernel state 62.Nd get or set kernel state
63.Sh SYNOPSIS 63.Sh SYNOPSIS
64.Nm sysctl 64.Nm sysctl
65.Op Fl AdeMn 65.Op Fl AdeMn
66.Oo 66.Oo
67.Fl r | 67.Fl r |
68.Fl x 68.Fl x
69.Oc 69.Oc
70.Op Ar name ... 70.Op Ar name ...
@@ -366,36 +366,26 @@ necessarily protected by this. @@ -366,36 +366,26 @@ necessarily protected by this.
366.Dq Hexadecimal . 366.Dq Hexadecimal .
367Make 367Make
368.Nm 368.Nm
369default to hexadecimal display of the retrieved value 369default to hexadecimal display of the retrieved value
370.It r 370.It r
371.Dq Read-only . 371.Dq Read-only .
372The data instrumented by the given node is read-only. 372The data instrumented by the given node is read-only.
373Note that other mechanisms may still exist for changing the data. 373Note that other mechanisms may still exist for changing the data.
374This is the default for nodes that instrument data. 374This is the default for nodes that instrument data.
375.It w 375.It w
376.Dq Writable . 376.Dq Writable .
377The data instrumented by the given node is writable at any time. 377The data instrumented by the given node is writable at any time.
378This is the default for nodes that can have children. 378This is the default for nodes that can have children.
379.It 1 
380.Dq Read-only at securelevel 1 . 
381The data instrumented by this node is writable until the securelevel 
382reaches or passes securelevel 1. 
383Examples of this include some network tunables. 
384.It 2 
385.Dq Read-only at securelevel 2 . 
386The data instrumented by this node is writable until the securelevel 
387reaches or passes securelevel 2. 
388An example of this is the per-process core filename setting. 
389.El 379.El
390.Pp 380.Pp
391.It 381.It
392.Ar value= Ns Aq Ar V 382.Ar value= Ns Aq Ar V
393An initial starting value for a new node that does not reference 383An initial starting value for a new node that does not reference
394existing kernel data. 384existing kernel data.
395Initial values can only be assigned for nodes of the 385Initial values can only be assigned for nodes of the
396.Dq int , 386.Dq int ,
397.Dq quad , 387.Dq quad ,
398and 388and
399.Dq string 389.Dq string
400types. 390types.
401.El 391.El
@@ -517,19 +507,18 @@ sysctl -w //describe=local.audiodebug=ge @@ -517,19 +507,18 @@ sysctl -w //describe=local.audiodebug=ge
517.Ed 507.Ed
518Note that the children are made writable so that the two debug 508Note that the children are made writable so that the two debug
519settings in question can be tuned arbitrarily. 509settings in question can be tuned arbitrarily.
520.Pp 510.Pp
521To destroy that same subtree: 511To destroy that same subtree:
522.Bd -literal -offset indent -compact 512.Bd -literal -offset indent -compact
523sysctl -w //destroy=local.esm_debug 513sysctl -w //destroy=local.esm_debug
524sysctl -w //destroy=local.audiodebug 514sysctl -w //destroy=local.audiodebug
525sysctl -w //destroy=local 515sysctl -w //destroy=local
526.Ed 516.Ed
527.Sh SEE ALSO 517.Sh SEE ALSO
528.Xr sysctl 3 , 518.Xr sysctl 3 ,
529.Xr ksyms 4 , 519.Xr ksyms 4 ,
530.Xr sysctl 7 , 520.Xr sysctl 7
531.Xr secmodel_securelevel 9 
532.Sh HISTORY 521.Sh HISTORY
533.Nm sysctl 522.Nm sysctl
534first appeared in 523first appeared in
535.Bx 4.4 . 524.Bx 4.4 .

cvs diff -r1.129 -r1.130 src/sbin/sysctl/sysctl.c (expand / switch to unified diff)

--- src/sbin/sysctl/sysctl.c 2009/04/01 15:55:27 1.129
+++ src/sbin/sysctl/sysctl.c 2009/09/30 04:30:50 1.130
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sysctl.c,v 1.129 2009/04/01 15:55:27 christos Exp $ */ 1/* $NetBSD: sysctl.c,v 1.130 2009/09/30 04:30:50 elad Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2003 The NetBSD Foundation, Inc. 4 * Copyright (c) 2003 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Brown. 8 * by Andrew Brown.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -58,27 +58,27 @@ @@ -58,27 +58,27 @@
58 * SUCH DAMAGE. 58 * SUCH DAMAGE.
59 */ 59 */
60 60
61#include <sys/cdefs.h> 61#include <sys/cdefs.h>
62#ifndef lint 62#ifndef lint
63__COPYRIGHT("@(#) Copyright (c) 1993\ 63__COPYRIGHT("@(#) Copyright (c) 1993\
64 The Regents of the University of California. All rights reserved."); 64 The Regents of the University of California. All rights reserved.");
65#endif /* not lint */ 65#endif /* not lint */
66 66
67#ifndef lint 67#ifndef lint
68#if 0 68#if 0
69static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93"; 69static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93";
70#else 70#else
71__RCSID("$NetBSD: sysctl.c,v 1.129 2009/04/01 15:55:27 christos Exp $"); 71__RCSID("$NetBSD: sysctl.c,v 1.130 2009/09/30 04:30:50 elad Exp $");
72#endif 72#endif
73#endif /* not lint */ 73#endif /* not lint */
74 74
75#include <sys/types.h> 75#include <sys/types.h>
76#include <sys/param.h> 76#include <sys/param.h>
77#include <sys/sysctl.h> 77#include <sys/sysctl.h>
78#include <sys/mount.h> 78#include <sys/mount.h>
79#include <sys/resource.h> 79#include <sys/resource.h>
80#include <sys/stat.h> 80#include <sys/stat.h>
81#include <sys/sched.h> 81#include <sys/sched.h>
82#include <sys/socket.h> 82#include <sys/socket.h>
83#include <netinet/in.h> 83#include <netinet/in.h>
84#include <netinet/ip_var.h> 84#include <netinet/ip_var.h>
@@ -902,30 +902,29 @@ parse(char *l) @@ -902,30 +902,29 @@ parse(char *l)
902 } 902 }
903} 903}
904 904
905/* 905/*
906 906
907 //create=foo.bar.whatever..., 907 //create=foo.bar.whatever...,
908 [type=(int|quad|string|struct|node),] 908 [type=(int|quad|string|struct|node),]
909 [size=###,] 909 [size=###,]
910 [n=###,] 910 [n=###,]
911 [flags=(iohxparw12),] 911 [flags=(iohxparw12),]
912 [addr=0x####,|symbol=...|value=...] 912 [addr=0x####,|symbol=...|value=...]
913 913
914 size is optional for some types. type must be set before anything 914 size is optional for some types. type must be set before anything
915 else. nodes can have [r12whp], but nothing else applies. if no 915 else. nodes can have [rwhp], but nothing else applies. if no
916 size or type is given, node is asserted. writeable is the default, 916 size or type is given, node is asserted. writeable is the default,
917 with [r12w] being read-only, writeable below securelevel 1, 917 with [rw] being read-only and unconditionally writeable
918 writeable below securelevel 2, and unconditionally writeable 
919 respectively. if you specify addr, it is assumed to be the name of 918 respectively. if you specify addr, it is assumed to be the name of
920 a kernel symbol, if value, CTLFLAG_OWNDATA will be asserted for 919 a kernel symbol, if value, CTLFLAG_OWNDATA will be asserted for
921 strings, CTLFLAG_IMMEDIATE for ints and u_quad_ts. you cannot 920 strings, CTLFLAG_IMMEDIATE for ints and u_quad_ts. you cannot
922 specify both value and addr. 921 specify both value and addr.
923 922
924*/ 923*/
925 924
926static void 925static void
927parse_create(char *l) 926parse_create(char *l)
928{ 927{
929 struct sysctlnode node; 928 struct sysctlnode node;
930 size_t sz; 929 size_t sz;
931 char *nname, *key, *value, *data, *addr, *c, *t; 930 char *nname, *key, *value, *data, *addr, *c, *t;