docs/62331: Documentation for kernel functions securelevel_gt and securelevel_ge

Christian S.J. Peron maneo at bsdpro.com
Wed Feb 4 05:10:24 UTC 2004


>Number:         62331
>Category:       docs
>Synopsis:       Documentation for kernel functions securelevel_gt and securelevel_ge
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 03 21:10:17 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Christian S.J. Peron
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD movl 5.2-CURRENT FreeBSD 5.2-CURRENT #8: Mon Feb 2 22:04:49 GMT 2004 maneo at movl:/usr/src/sys/i386/compile/ROUTER i386


	
>Description:
	I have written a manual page for the securelevel_gt(9)
	and securelevel_ge(9) kernel functions.

	Brief description:
	securelevel_gt, securelevel_ge -- test active securelevel

	I have included a diff to $PREFIX/share/man/man9/Makefile
	along with a shar of the man page itself.

	
>How-To-Repeat:
N/A
	
>Fix:

--- share/man/man9/Makefile.old	Wed Feb  4 04:03:53 2004
+++ share/man/man9/Makefile	Wed Feb  4 04:06:41 2004
@@ -166,6 +166,7 @@
 	runqueue.9 \
 	sbuf.9 \
 	scheduler.9 \
+	securelevel_gt.9 \
 	selrecord.9 \
 	sema.9 \
 	signal.9 \
@@ -645,6 +646,7 @@
 	scheduler.9 sched_setup.9 \
 	scheduler.9 setrunnable.9 \
 	scheduler.9 updatepri.9
+MLINKS+=securelevel_gt.9 securelevel_ge.9
 MLINKS+=selrecord.9 selwakeup.9
 MLINKS+=sema.9 sema_destroy.9 \
 	sema.9 sema_init.9 \


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	/usr/src/share/man/man9/securelevel_gt.9
#
echo x - /usr/src/share/man/man9/securelevel_gt.9
sed 's/^X//' >/usr/src/share/man/man9/securelevel_gt.9 << 'END-of-/usr/src/share/man/man9/securelevel_gt.9'
X.\"
X.\" Copyright (c) 2000, Christian S.J. Peron <maneo at bsdpro.com>
X.\" All rights reserved.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\" 3. The name of the author may not be used to endorse or promote products
X.\"    derived from this software without specific prior written permission.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.Dd February 3, 2003
X.Dt SECURELEVEL_GT 9
X.Os
X.Sh NAME
X.Nm securelevel_gt ,
X.Nm securelevel_ge 
X.Nd test active securelevel
X.Sh SYNOPSIS
X.In sys/types.h
X.In sys/proc.h
X.Ft int
X.Fo securelevel_gt 
X.Fa "struct ucred *cr"
X.Fa "int level"
X.Fc
X.Ft int
X.Fo securelevel_ge  
X.Fa "struct ucred *cr"
X.Fa "int level"
X.Fc
X.Sh DESCRIPTION
XThese functions test the active security level against the given
X.Fa level .
XIf the calling credential 
X.Fa cr
Xwas imprisoned by the jail(2) system call, and has a
Xdifferent security level set than the host environment,
Xthe security level with the highest value is used.
X.Pp
X.Nm securelevel_gt
Xwill evaluate weather or not the active security
Xlevel is greater than the supplied 
X.Fa level .
XIf the active security level is greater than
X.Fa level ,
XEPERM is returned.
X.Pp
X.Nm securelevel_ge
Xwill evaluate weather or not the active security
Xlevel is greater than or equal to the supplied
X.Fa level .
XIf the active security level is greater than or equal to
X.Fa level ,
XEPERM is returned.
X.Sh "RETURN VALUES"
XThe logic is inverted, these functions return
XEPERM on "success" and 0 on "failure".
X.Sh "SEE ALSO"
X.Xr init 8 ,
X.Xr sysctl 8
X
END-of-/usr/src/share/man/man9/securelevel_gt.9
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list