doc/ja_JP.eucJP/man/man9/suser.9
Kazuo Horikawa 205daa8301 New man9 entries translated by Ikeuchi-san.
Submitted by:	Akira Ikeuchi <a_ikeuchi@mic.mitsumi.co.jp>
2002-09-01 07:12:09 +00:00

102 lines
3.5 KiB
Groff

.\"
.\" Copyright (c) 1996 Julian R Elischer
.\" All rights reserved.
.\"
.\" This code is derived from software contributed by Kenneth Stailey.
.\"
.\" 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 for the FreeBSD Project
.\" by Julian R Elischer
.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
.\"
.\" %FreeBSD: src/share/man/man9/suser.9,v 1.9.2.5 2001/12/17 11:30:19 ru Exp %
.\" $FreeBSD$
.\"
.Dd October 15, 1996
.Dt SUSER 9
.Os
.Sh 名称
.Nm suser
.Nd スーパユーザかどうかのチェックと記録
.Sh 書式
.In sys/param.h
.In sys/proc.h
.In sys/ucred.h
.Ft int
.Fn suser "struct proc *proc"
.Ft int
.Fn suser_xxx "struct ucred *cred" "struct proc *proc" "int flags"
.Sh 解説
.Nm
および
.Nm suser_xxx
関数は、スーパユーザの権限を含む証明が与えられているかどうかをチェックします。
.Pp
.Nm
関数は最も普通で、特別な事情がその他の方法を要求するのでなければ、
これが使用されるべきです。
.Pp
.Nm suser_xxx
関数は、チェックされるべき証明がそのプロセス自身のものでない時、
プロセスが存在しない時、またはスーパユーザの権限が
閉じ込められた root に拡大されるべき時に、使用されるべきです。
.Pp
デフォルトでは、
.Xr jail 2
システムコールによって閉じ込められている場合には、
プロセスはスーパユーザの権限を持ちません。
しかしながら、これが適切な場合があり、
.Nm suser_xxx
関数への flags 引数の
.Dv PRISON_ROOT
ビットを設定することによって実現されます。
これが牢屋を弱くしないことを、注意深く再調査することが重要です。
一般的には
.Xr jail 2
呼び出しの中の暗黙の
.Xr chroot 2
によって行動が保護されている場所のみにおいて、
このような権限を承諾されるべきです。
.Pp
.Nm
および
.Nm suser_xxx
関数は、スーパユーザの権限が使用された事を、
指定されたプロセスのプロセス構造体中に記録します。
これらの関数の機能の一部は、スーパユーザの権限が使用されたかどうかを
通知することにありますので、
他のパーミションの可能性が使い尽くされた後でのみ、
これら関数を呼び出すべきです。
.Sh 戻り値
.Nm
および
.Nm suser_xxx
関数は、そのユーザがスーパユーザの権限を持っている場合には 0 を返し、
そうでない場合には
.Er EPERM
を返します。
これは、TRUE の応答がスーパユーザ権限を持つことを示すような他の実装とは
.Em 逆の論理
になっています。