diff options
Diffstat (limited to 'documentation/manual-pages/ja/man9/suser.9')
-rw-r--r-- | documentation/manual-pages/ja/man9/suser.9 | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/documentation/manual-pages/ja/man9/suser.9 b/documentation/manual-pages/ja/man9/suser.9 new file mode 100644 index 0000000000..0817ea5ee7 --- /dev/null +++ b/documentation/manual-pages/ja/man9/suser.9 @@ -0,0 +1,128 @@ +.\" +.\" 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.25.2.2 2005/01/05 08:31:19 krion Exp % +.\" $FreeBSD$ +.\" +.Dd April 2, 2002 +.Dt SUSER 9 +.Os +.Sh 名称 +.Nm suser , +.Nm suser_cred +.Nd 証明がスーパユーザの権限を持っているかどうかのチェック +.Sh 書式 +.In sys/param.h +.In sys/systm.h +.Ft int +.Fn suser "struct thread *td" +.Ft int +.Fn suser_cred "struct ucred *cred" "int flag" +.Sh 解説 +.Fn suser +および +.Fn suser_cred +関数は、スーパユーザの権限を含む証明が与えられているかどうかをチェックします。 +.Pp +.Fn suser +関数は最も普通で、特別な事情がその他の方法を要求するのでなければ、 +これが使用されるべきです。 +.Pp +.Fn suser_cred +関数は、チェックされるべき証明がそのスレッド自身のものでない時、 +スレッドが存在しない時、スーパユーザの権限が +閉じ込められた root に拡大されるべき時、またはチェックされるべき証明が +実効ユーザというよりは実際のユーザである時に、使用されるべきです。 +.Pp +デフォルトでは、 +.Xr jail 2 +システムコールによって閉じ込められている場合には、 +プロセスはスーパユーザの権限を持ちません。 +しかしながら、これが適切な場合があり、 +.Fn suser_cred +関数へ渡す +.Fa flag +引数に +.Dv SUSER_ALLOWJAIL +ビットを設定することによって実現されます。 +これが牢屋を弱くしないことを、注意深く再調査することが重要です。 +一般的には +.Xr jail 2 +呼び出しの中の暗黙の +.Xr chroot 2 +によって行動が保護されている場所のみにおいて、 +このような権限を承諾されるべきです。 +.Pp +デフォルトでは、チェックされる証明は実効ユーザです。 +代わりに実際のユーザをチェックする必要がある場合 (例えば、 +リソースリミットが適用された場合の決定のとき) があります。 +そして、これは +.Fn suser_cred +関数への +.Fa flag +引数に +.Dv SUSER_RUID +を渡すことによって行うことが可能です。 +.Pp +.Fn suser +および +.Fn suser_cred +関数は、スーパユーザの権限が使用された事を、 +指定されたプロセスのプロセス構造体中に記録します。 +これらの関数の機能の一部は、スーパユーザの権限が使用されたかどうかを +通知することにありますので、 +他のパーミッションの可能性が使い尽くされた後でのみ、 +これら関数を呼び出すべきです。 +.Sh 戻り値 +.Fn suser +および +.Fn suser_cred +関数は、そのユーザがスーパユーザの権限を持っている場合には 0 を返し、 +そうでない場合には +.Er EPERM +を返します。 +これは、TRUE の応答がスーパユーザ権限を持つことを示すような他の実装とは +.Em 逆の論理 +になっています。 +TRUE の応答の +.Fn suser +はスーパユーザの権限を示します。 +.Sh 関連項目 +.Xr chroot 2 , +.Xr jail 2 +.Sh バグ +.Fn suser +および +.Fn suser_cred +関数は事実上は 2000 年の 8 月から、 +スーパユーザの特権が使用されたことおよびされなかったことを記録しません。 |