.\" written by Andrew Morgan <morgan@kernel.org>
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
.\" may be distributed as per GPL
+.\" %%%LICENSE_END
+.\"
.\" Modified by David A. Wheeler <dwheeler@ida.org>
.\" Modified 2004-05-27, mtk
.\" Modified 2004-06-21, aeb
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH CAPGET 2 2010\-09\-20 Linux "Linux Programmer's Manual"
+.TH CAPGET 2 2013\-03\-11 Linux "Linux Programmer's Manual"
.SH 名前
capget, capset \- スレッドのケーパビリティを設定/取得する
.SH 書式
\fBexecve\fP(2) を通じて渡すことができるケーパビリティの集合であり、 「許可ケーパビリティ (permitted capability)
の集合」は 実効ケーパビリティや継承可能ケーパビリティとして有効にできる ケーパビリティを規定するものである。
.PP
-この二つの関数はスレッドのケーパビリティを取得したり設定したりするための 生のカーネルインターフェースである。 これらのシステムコールは Linux
-特有であるというだけでなく、 カーネル API は変更されるかもしれず、これらの 関数の使用法 (特に \fIcap_user_*_t\fP 型という書式)
-はカーネルのリビジョン毎に拡張されるかもしれないが、 以前のプログラムはそのまま動作する。
+These two system calls are the raw kernel interface for getting and setting
+thread capabilities. Not only are these system calls specific to Linux, but
+the kernel API is likely to change and use of these system calls (in
+particular the format of the \fIcap_user_*_t\fP types) is subject to extension
+with each kernel revision, but old programs will keep working.
.sp
移植性のあるインターフェースは \fBcap_set_proc\fP(3) と \fBcap_get_proc\fP(3) である。
可能ならばアプリケーションはこれらの関数を使用すべきである。 アプリケーションに Linux 拡張を使用したい場合には、より簡単に
.fi
.in -4n
.sp
-\fIeffective, permitted, inheritable\fP は、 \fBcapability\fP(7)
-で定義されるケーパビリティのビットマスクである。 \fICAP_*\fP はビット番号を表すインデックス値であり、 ビットフィールドに OR を行う前に
-\fICAP_*\fP の値の分だけビットシフトを行う必要がある。 typedef の方はポインタなので、 このシステムコールに渡す構造体を定義するには、
-\fIstruct __user_cap_header_struct\fP と \fIstruct __user_cap_data_struct\fP
-という名前を使用しなければならない。
+The \fIeffective\fP, \fIpermitted\fP, and \fIinheritable\fP fields are bit masks of
+the capabilities defined in \fIcapability(7).\fP Note the \fBCAP_*\fP values are
+bit indexes and need to be bit\-shifted before ORing into the bit fields. To
+define the structures for passing to the system call you have to use the
+\fIstruct __user_cap_header_struct\fP and \fIstruct __user_cap_data_struct\fP
+names because the typedefs are only pointers.
カーネル 2.6.25 より前では、バージョン \fB_LINUX_CAPABILITY_VERSION_1\fP の 32
ビットケーパビリティが推奨である。 カーネル 2.6.25 以降では、バージョン \fB_LINUX_CAPABILITY_VERSION_2\fP の 64
.sp
\fBcapget\fP() では、 \fIhdrp\->pid\fP のフィールド値にケーパビリティを知りたいプロセスのプロセス ID を
指定することで、任意のプロセスのケーパビリティを調べることができる。
-.SS "VFS ケーパビリティがサポートされている場合"
+.SS "With VFS capability support"
VFS ケーパビリティのサポートでは、特権実行ファイルにケーパビリティを 追加するためのファイル属性メソッドが作成された。
この特権モデルの導入により、あるプロセスにより別のプロセスのケーパビリティ を非同期に設定する機能のカーネルによるサポートは廃止される。 つまり、VFS
サポートでは、 \fBcapset\fP() を呼び出す際に \fIhdrp\->pid\fP の値として許されるのは 0 と \fBgetpid\fP(2)
が返す値だけとなる (どちらの値でも等価である)。
-.SS "VFS ケーパビリティがサポートされていない場合"
+.SS "Without VFS capability support"
カーネルが VFS ケーパビリティをサポートしていない場合、 \fIhdrp\fP の \fIpid\fP フィールドが 0 以外であれば、 \fBcapset\fP()
の操作対象は \fIpid\fP で指定されたスレッドのケーパビリティになる。 \fIpid\fP が 0
の場合は呼び出し元のスレッドのケーパビリティが操作対象となる。 \fIpid\fP がシングルスレッド・プロセスを参照している場合、 \fIpid\fP
ケーパビリティを設定したり取得したりする機能のための移植性ある インターフェースは \fIlibcap\fP ライブラリによって提供される。
このライブラリは以下から入手できる:
.br
-http://www.kernel.org/pub/linux/libs/security/linux\-privs
+.UR http://git.kernel.org/cgit\:/linux\:/kernel\:/git\:/morgan\:\:/libcap.git
+.UE
.SH 関連項目
\fBclone\fP(2), \fBgettid\fP(2), \fBcapabilities\fP(7)
.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
である。プロジェクトの説明とバグ報告に関する情報は
http://www.kernel.org/doc/man\-pages/ に書かれている。