OSDN Git Service

Translation snapshot of process of 3.76
[linuxjm/LDP_man-pages.git] / draft / man2 / setresuid.2
index 27d22a2..31cbcfa 100644 (file)
@@ -1,7 +1,6 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
 .\"
 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
 .\"         all rights reserved.
 .\" Updated & Modified 2005-01-04, Yuichi SATO
 .\" Updated & Modified 2005-09-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
 .\" Updated & Modified 2005-11-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
 .\"
-.\"WORD:       effective user ID       ¼Â¸ú¥æ¡¼¥¶¡¼ID
-.\"WORD:       real user ID            ¼Â¥æ¡¼¥¶¡¼ID
-.\"WORD:       saved set-user-ID       Êݸ¥»¥Ã¥È¥æ¡¼¥¶¡¼ID
-.\"WORD:       effective group ID      ¼Â¸ú¥°¥ë¡¼¥×ID
-.\"WORD:       real group ID           ¼Â¥°¥ë¡¼¥×ID
-.\"WORD:       saved group ID          Êݸ¥°¥ë¡¼¥×ID
-.\"
-.TH SETRESUID 2 2007-07-26 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O setresuid, setresgid \- set real, effective and saved user or group ID
-setresuid, setresgid \- ¥æ¡¼¥¶¤ä¥°¥ë¡¼¥×¤Î ¼Â¡¢¼Â¸ú¡¢Êݸ ID ¤òÀßÄꤹ¤ë
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
-.B #define _GNU_SOURCE
+.TH SETRESUID 2 2014\-09\-21 Linux "Linux Programmer's Manual"
+.SH 名前
+setresuid, setresgid \- ユーザやグループの 実、実効、保存 ID を設定する
+.SH 書式
+\fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */
 .br
-.B #include <unistd.h>
+\fB#include <unistd.h>\fP
 .sp
-.BI "int setresuid(uid_t " ruid ", uid_t " euid ", uid_t " suid );
+\fBint setresuid(uid_t \fP\fIruid\fP\fB, uid_t \fP\fIeuid\fP\fB, uid_t \fP\fIsuid\fP\fB);\fP
 .br
-.BI "int setresgid(gid_t " rgid ", gid_t " egid ", gid_t " sgid );
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O .BR setresuid ()
-.\"O sets the real user ID, the effective user ID, and the
-.\"O saved set-user-ID of the calling process.
-.BR setresuid ()
-¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶¡¼ID¡¢¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ID¡¢
-Êݸ set-user-ID ¤òÀßÄꤹ¤ë¡£
+\fBint setresgid(gid_t \fP\fIrgid\fP\fB, gid_t \fP\fIegid\fP\fB, gid_t \fP\fIsgid\fP\fB);\fP
+.SH 説明
+\fBsetresuid\fP()  は呼び出し元のプロセスの実 (real) ユーザーID、実効 (effective) ユーザーID、 保存
+set\-user\-ID を設定する。
+
+非特権ユーザーのプロセスは、その実 UID、実効 UID、保存 set\-user\-ID を、 現在の実 UID、現在の実効 UID、現在の保存
+set\-user\-ID のどれかに変更することができる:
+
+特権プロセス (Linux では \fBCAP_SETUID\fP ケーパビリティ (capability) を持つ プロセス) は、実 UID、実効
+UID、保存 set\-user\-ID を任意の値に設定できる。
 
-.\"O Unprivileged user processes
-.\"O may change the real UID,
-.\"O effective UID and saved set-user-ID, each to one of:
-.\"O the current real UID, the current effective UID or the
-.\"O current saved set-user-ID.
-ÈóÆø¢¥æ¡¼¥¶¡¼¤Î¥×¥í¥»¥¹¤Ï¡¢¤½¤Î¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤ò¡¢
-¸½ºß¤Î¼Â UID¡¢¸½ºß¤Î¼Â¸ú UID¡¢¸½ºß¤ÎÊݸ set-user-ID
-¤Î¤É¤ì¤«¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë:
+引き数のどれかが \-1 の場合はその値は変更されずに残される。
 
-.\"O Privileged processes (on Linux, those having the \fBCAP_SETUID\fP capability)
-.\"O may set the real UID, effective UID, and
-.\"O saved set-user-ID to arbitrary values.
-Æø¢¥×¥í¥»¥¹ (Linux ¤Ç¤Ï \fBCAP_SETUID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ä
-¥×¥í¥»¥¹) ¤Ï¡¢¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤òǤ°Õ¤ÎÃͤËÀßÄê¤Ç¤­¤ë¡£
+実 UID、実効 UID、保存 set\-user\-ID にどんな変更が行われたかに関わらず、 ファイルシステム UID は常に実効 UID
+(可能であれば変更後の新しい実効 UID)  と同じ値に設定される。
 
-.\"O If one of the arguments equals \-1, the corresponding value is not changed.
-°ú¤­¿ô¤Î¤É¤ì¤«¤¬ \-1 ¤Î¾ì¹ç¤Ï¤½¤ÎÃͤÏÊѹ¹¤µ¤ì¤º¤Ë»Ä¤µ¤ì¤ë¡£
+全く同じように、 \fBsetresgid\fP()  は呼び出し元のプロセスの実 GID、実効 GID、保存 set\-group\-ID を設定する
+(さらにファイルシステム GID を実効 GID と同じ値に修正する)。 非特権プロセスは同様の制限を受ける。
+.SH 返り値
+成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
 
-.\"O Regardless of what changes are made to the real UID, effective UID,
-.\"O and saved set-user-ID, the file system UID is always set to the same
-.\"O value as the (possibly new) effective UID.
-¼Â UID¡¢¼Â¸ú UID¡¢Êݸ set-user-ID ¤Ë¤É¤ó¤ÊÊѹ¹¤¬¹Ô¤ï¤ì¤¿¤«¤Ë´Ø¤ï¤é¤º¡¢
-¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à UID ¤Ï¾ï¤Ë¼Â¸ú UID (²Äǽ¤Ç¤¢¤ì¤ÐÊѹ¹¸å¤Î¿·¤·¤¤¼Â¸ú UID)
-¤ÈƱ¤¸ÃͤËÀßÄꤵ¤ì¤ë¡£
+\fI注意\fP: 呼び出し元が UID 0 であっても \fBsetresuid\fP() が失敗する場合がある。 \fBsetresuid\fP()
+からのリターンが失敗かどうかの確認を省略することは重大なセキュリティ上のエラーとなる。
+.SH エラー
+.TP 
+\fBEAGAIN\fP
+この呼び出しで呼び出し元の実 UID が変更されるはずだったが (つまり、 \fIruid\fP が呼び出し元の実 UID と一致していない)、
+必要なカーネルのデータ構造体の割り当てで一時的な失敗があった。
+.TP 
+\fBEAGAIN\fP
+\fIruid\fP は呼び出し元の実 UID と一致しておらず、 この呼び出しで実ユーザー ID \fIruid\fP に属するプロセス数が呼び出し元の
+\fBRLIMIT_NPROC\fP リソース上限を超過するところであった。 Linux 3.1 以降では、このエラーはもはや発生することはない
+(しかし、堅牢性が求められるアプリケーションではこのエラーを確認すべきである)。 \fBexecve\fP(2) の \fBEAGAIN\fP の説明を参照。
+.TP 
+\fBEINVAL\fP
+対象のユーザー ID やグループ ID のうち 1 つ以上がこのユーザー名前空間で有効ではない。
+.TP 
+\fBEPERM\fP
+呼び出したプロセスが特権を持たないのに (\fBCAP_SETUID\fP ケーパビリティを持たないのに)、 ID を許されていない値に変更しようとした。
+.SH バージョン
+Linux ではバージョン 2.1.44 より利用可能になった。
+.SH 準拠
+これらのコールは非標準である。 HP\-UX や BSD 系のいくつかにも存在する。
+.SH 注意
+HP\-UX や FreeBSD では \fI<unistd.h>\fP にプロトタイプが存在する。
+Linux では、glibc 2.3.2 以降で プロトタイプが提供されている。
 
-.\"O Completely analogously,
-.\"O .BR setresgid ()
-.\"O sets the real GID, effective GID, and saved set-group-ID
-.\"O of the calling process (and always modifies the file system GID
-.\"O to be the same as the effective GID),
-.\"O with the same restrictions for unprivileged processes.
-Á´¤¯Æ±¤¸¤è¤¦¤Ë¡¢
-.BR setresgid ()
-¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â GID¡¢¼Â¸ú GID¡¢Êݸ set-group-ID ¤òÀßÄꤹ¤ë
-(¤µ¤é¤Ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à GID ¤ò¼Â¸ú GID ¤ÈƱ¤¸Ãͤ˽¤Àµ¤¹¤ë)¡£
-ÈóÆø¢¥×¥í¥»¥¹¤ÏƱÍͤÎÀ©¸Â¤ò¼õ¤±¤ë¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O On success, zero is returned.
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
-.I errno
-¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.TP
-.B EAGAIN
-.\"O .I uid
-.\"O does not match the current UID and this call would
-.\"O bring that user ID over its
-.\"O .B RLIMIT_NPROC
-.\"O resource limit.
-.I uid
-¤¬¸½ºß¤Î¥æ¡¼¥¶¡¼ ID ¤È°ã¤¦Ãͤǡ¢
-¤³¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê ¥æ¡¼¥¶¡¼ ID ¤¬
-¥ê¥½¡¼¥¹¾å¸Â
-.B RLIMIT_NPROC
-¤òĶ¤¨¤Æ¤·¤Þ¤¦¡£
-.TP
-.B EPERM
-.\"O The calling process is not privileged (did not have the \fBCAP_SETUID\fP
-.\"O capability) and tried to change the IDs to values that are not permitted.
-¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤¤¤Î¤Ë
-(\fBCAP_SETUID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¤Î¤Ë)¡¢
-ID ¤òµö¤µ¤ì¤Æ¤¤¤Ê¤¤ÃͤËÊѹ¹¤·¤è¤¦¤È¤·¤¿¡£
-.\"O .SH VERSIONS
-.SH ¥Ð¡¼¥¸¥ç¥ó
-.\"O It is available under Linux since Linux 2.1.44.
-Linux ¤Ç¤Ï¥Ð¡¼¥¸¥ç¥ó 2.1.44 ¤è¤êÍøÍѲÄǽ¤Ë¤Ê¤Ã¤¿¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O These calls are nonstandard;
-.\"O they also appear on HP-UX and some of the BSDs.
-¤³¤ì¤é¤Î¥³¡¼¥ë¤ÏÈóɸ½à¤Ç¤¢¤ë¡£
-HP-UX ¤ä BSD ·Ï¤Î¤¤¤¯¤Ä¤«¤Ë¤â¸ºß¤¹¤ë¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O Under HP-UX and FreeBSD the prototype is found in
-.\"O .IR <unistd.h> .
-HP-UX ¤ä FreeBSD ¤Ç¤Ï
-.I <unistd.h>
-¤Ë¥×¥í¥È¥¿¥¤¥×¤¬Â¸ºß¤¹¤ë¡£
-.\"O Under Linux the prototype is provided by glibc since version 2.3.2.
-Linux ¤Ç¤Ï¡¢glibc 2.3.2 °Ê¹ß¤Ç
-¥×¥í¥È¥¿¥¤¥×¤¬Ä󶡤µ¤ì¤Æ¤¤¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR getresuid (2),
-.BR getuid (2),
-.BR setfsgid (2),
-.BR setfsuid (2),
-.BR setreuid (2),
-.BR setuid (2),
-.BR capabilities (7),
-.BR credentials (7),
-.BR feature_test_macros (7)
+元々の Linux の \fBsetresuid\fP() と \fBsetresgid\fP() システムコールは
+16 ビットのグループ ID だけに対応していた。
+その後、Linux 2.4 で、32 ビットの ID に対応した
+\fBsetresuid32\fP() と \fBsetresgid32\fP() が追加された。
+glibc の \fBsetresuid\fP() と \fBsetresgid\fP() のラッパー関数は
+カーネルバージョンによるこの違いを吸収している。
+.SH 関連項目
+\fBgetresuid\fP(2), \fBgetuid\fP(2), \fBsetfsgid\fP(2), \fBsetfsuid\fP(2),
+\fBsetreuid\fP(2), \fBsetuid\fP(2), \fBcapabilities\fP(7), \fBcredentials\fP(7),
+\fBuser_namespaces\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.76 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。