.\" by Yuichi SATO <ysato444@yahoo.co.jp>
.\" Updated 2010-04-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.24
.\"
-.\"WORD: effective user ID ¼Â¸ú¥æ¡¼¥¶¡¼ID
-.\"WORD: real user ID ¼Â¥æ¡¼¥¶¡¼ID
-.\"WORD: saved user ID Êݸ¥æ¡¼¥¶¡¼ID
-.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼
+.\"WORD: effective user ID å®\9få\8a¹ã\83¦ã\83¼ã\82¶ã\83¼ID
+.\"WORD: real user ID å®\9fã\83¦ã\83¼ã\82¶ã\83¼ID
+.\"WORD: saved user ID ä¿\9då\98ã\83¦ã\83¼ã\82¶ã\83¼ID
+.\"WORD: super-user ã\82¹ã\83¼ã\83\91ã\83¼ã\83»ã\83¦ã\83¼ã\82¶ã\83¼
.\"
.TH SETREUID 2 2010-09-20 "Linux" "Linux Programmer's Manual"
.\"O .SH NAME
-.SH ̾Á°
+.SH 名前
.\"O setreuid, setregid \- set real and/or effective user or group ID
-setreuid, setregid \- ¼Â (real) ¤È¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÀßÄꤹ¤ë
+setreuid, setregid \- 実 (real) と実効 (effective) ユーザー (グループ) ID を設定する
.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.SH 書式
.B #include <sys/types.h>
.br
.B #include <unistd.h>
.in -4n
.\"O Feature Test Macro Requirements for glibc (see
.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
+glibc 向けの機能検査マクロの要件
.RB ( feature_test_macros (7)
-»²¾È):
+参照):
.in
.sp
.BR setreuid (),
.ad
.RE
.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
+.SH 説明
.\"O .BR setreuid ()
.\"O sets real and effective user IDs of the calling process.
.BR setreuid ()
-¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â (real) ¥æ¡¼¥¶¡¼ ID ¤È
-¼Â¸ú (effective) ¥æ¡¼¥¶¡¼ ID ¤òÀßÄꤹ¤ë¡£
+は呼び出し元のプロセスの実 (real) ユーザー ID と
+実効 (effective) ユーザー ID を設定する。
.\"O Supplying a value of \-1 for either the real or effective user ID forces
.\"O the system to leave that ID unchanged.
-¼Â¥æ¡¼¥¶¡¼ ID ¤ä¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Ë \-1 ¤òÍ¿¤¨¤¿¾ì¹ç¡¢
-¥·¥¹¥Æ¥à¤Ï¤½¤Î ID ¤òÊѹ¹¤·¤Ê¤¤¡£
+実ユーザー ID や実効ユーザー ID に \-1 を与えた場合、
+システムはその ID を変更しない。
.\"O Unprivileged processes may only set the effective user ID to the real user ID,
.\"O the effective user ID, or the saved set-user-ID.
-ÈóÆø¢¥×¥í¥»¥¹¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤ò¼Â¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï
-Êݸ set-user-ID ¤Ë¤·¤«ÀßÄê¤Ç¤¤Ê¤¤¡£
+非特権プロセスは実効ユーザー ID を実ユーザー ID または実効ユーザー ID または
+保存 set-user-ID にしか設定できない。
.\"O Unprivileged users may only set the real user ID to
.\"O the real user ID or the effective user ID.
-ÈóÆø¢¥æ¡¼¥¶¡¼¤Ï¡¢¼Â¥æ¡¼¥¶¡¼ ID ¤ò¼Â¥æ¡¼¥¶¡¼ ID ¤Þ¤¿¤Ï
-¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤Ë¤·¤«ÀßÄê¤Ç¤¤Ê¤¤¡£
+非特権ユーザーは、実ユーザー ID を実ユーザー ID または
+実効ユーザー ID にしか設定できない。
.\"O If the real user ID is set or the effective user ID is set to a value
.\"O not equal to the previous real user ID,
.\"O the saved set-user-ID will be set to the new effective user ID.
-¼Â¥æ¡¼¥¶¡¼ID ¤¬ÀßÄꤵ¤ì¤¿¤ê¡¢¼Â¸ú¥æ¡¼¥¶¡¼ID ¤¬Á°¤Î¼Â¥æ¡¼¥¶¡¼ID ¤È
-°Û¤Ã¤¿ÃͤËÀßÄꤵ¤ì¤¿¾ì¹ç¡¢Êݸ set-user-ID ¤Ë¤Ï¿·¤·¤¤¼Â¸ú¥æ¡¼¥¶¡¼ID
-¤ÎÃͤ¬ÀßÄꤵ¤ì¤ë¡£
+実ユーザーID が設定されたり、実効ユーザーID が前の実ユーザーID と
+ç\95°ã\81£ã\81\9få\80¤ã\81«è¨å®\9aã\81\95ã\82\8cã\81\9få ´å\90\88ã\80\81ä¿\9då\98 set-user-ID ã\81«ã\81¯æ\96°ã\81\97ã\81\84å®\9få\8a¹ã\83¦ã\83¼ã\82¶ã\83¼ID
+の値が設定される。
.\"O Completely analogously,
.\"O .BR setregid ()
.\"O sets real and effective group ID's of the calling process,
.\"O and all of the above holds with "group" instead of "user".
-¤³¤ì¤ÈÁ´¤¯Æ±Íͤˡ¢
+これと全く同様に、
.BR setregid ()
-¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥× ID ¤È¼Â¸ú¥°¥ë¡¼¥× ID ¤òÀßÄꤷ¡¢
-¾åµ¤ÎÀâÌÀ¤Ç¡Ö¥æ¡¼¥¶¡¼¡×¤ò¡Ö¥°¥ë¡¼¥×¡×¤ËÆɤßÂؤ¨¤¿¤³¤È¤¬À®¤êΩ¤Ä¡£
+は呼び出し元のプロセスの実グループ ID と実効グループ ID を設定し、
+上記の説明で「ユーザー」を「グループ」に読み替えたことが成り立つ。
.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
+.SH 返り値
.\"O On success, zero is returned.
.\"O On error, \-1 is returned, and
.\"O .I errno
.\"O is set appropriately.
-À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
+成功した場合は 0 が返される。エラーの場合は \-1 が返され、
.I errno
-¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
+が適切に設定される。
.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
+.SH ã\82¨ã\83©ã\83¼
.TP
.B EPERM
.\"O The calling process is not privileged
.\"O or (ii) setting one to the value of the other or (iii) setting the
.\"O effective user (group) ID to the value of the
.\"O saved set-user-ID (saved set-group-ID) was specified.
-¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ËÆø¢¤¬¤Ê¤¯
-(Linux ¤Ç¤Ï
+呼び出し元のプロセスに特権がなく
+(Linux では
.BR setreuid ()
-¤Î¾ì¹ç¤Ë
+の場合に
.B CAP_SETUID
-¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤¬¤Ê¤¯¡¢
+ケーパビリティ (capability) がなく、
.BR setregid ()
-¤Î¾ì¹ç¤Ë
+の場合に
.B CAP_SETGID
-¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¤)¡¢
-°Ê²¼¤Î¤¤¤º¤ì¤Ç¤â¤Ê¤¤Êѹ¹¤¬»ØÄꤵ¤ì¤¿:
-(i) ¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤È¼Â¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÆþ¤ì´¹¤¨¤ë¡£
-(ii) ÊÒÊý¤ÎÃͤò¾Êý¤ËÀßÄꤹ¤ë¡£
-(iii) ¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤ËÊݸ set-user-ID (Êݸ set-group-ID)
-¤ÎÃͤòÀßÄꤹ¤ë¡£
+ケーパビリティがない)、
+以下のいずれでもない変更が指定された:
+(i) 実効ユーザー (グループ) ID と実ユーザー (グループ) ID を入れ換える。
+(ii) 片方の値を他方に設定する。
+(iii) 実効ユーザー (グループ) ID に保存 set-user-ID (保存 set-group-ID)
+の値を設定する。
.\"O .SH "CONFORMING TO"
-.SH ½àµò
+.SH 準拠
.\"O POSIX.1-2001, 4.3BSD (the
.\"O .BR setreuid ()
.\"O and
.\"O function calls first appeared in 4.2BSD).
POSIX.1-2001, 4.3BSD
.RB ( setreuid ()
-¤È
+と
.BR setregid ()
-´Ø¿ô¥³¡¼¥ë¤Ï 4.2BSD ¤ÇÅо줷¤¿)¡£
+関数コールは 4.2BSD で登場した)。
.\"O .SH NOTES
-.SH Ãí°Õ
+.SH 注意
.\"O Setting the effective user (group) ID to the
.\"O saved set-user-ID (saved set-group-ID) is
.\"O possible since Linux 1.1.37 (1.1.38).
-¼Â¸ú¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤òÊݸ¥æ¡¼¥¶¡¼ (¥°¥ë¡¼¥×) ID ¤Ë
-ÀßÄꤹ¤ë¤³¤È¤¬¡¢Linux 1.1.37 (1.1.38) ¤«¤é²Äǽ¤Ë¤Ê¤Ã¤¿¡£
+実効ユーザー (グループ) ID を保存ユーザー (グループ) ID に
+設定することが、Linux 1.1.37 (1.1.38) から可能になった。
.\"O POSIX.1 does not specify all of possible ID changes that are permitted
.\"O on Linux for an unprivileged process.
-POSIX.1 ¤Ç¤Ï¡¢ÈóÆø¢¥×¥í¥»¥¹¤ËÂФ·¤Æ Linux ¾å¤Çǧ¤á¤é¤ì¤Æ¤¤¤ë ID ¤ÎÊѹ¹¤Î
-Á´¥Ñ¥¿¡¼¥ó¤òµ¬Äꤷ¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£
+POSIX.1 では、非特権プロセスに対して Linux 上で認められている ID の変更の
+全パターンを規定しているわけではない。
.\"O For
.\"O .BR setreuid (),
.\"O the effective user ID can be made the same as the
.\"O real user ID to the real user ID, the effective user ID, or the
.\"O saved set-user-ID.
.BR setreuid ()
-¤Ç¤Ï¡¢¼Â¸ú¥æ¡¼¥¶ ID ¤ò¼Â¥æ¡¼¥¶ ID ¤â¤·¤¯¤ÏÊݸ set-user-ID ¤È
-Ʊ¤¸Ãͤˤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¤¬¡¢
-ÈóÆø¢¥×¥í¥»¥¹¤¬¼Â¥æ¡¼¥¶ ID ¤ò¼Â¥æ¡¼¥¶ ID¡¢¼Â¸ú¥æ¡¼¥¶ ID¡¢
-Êݸ set-user-ID ¤Î¤É¤ÎÃͤˤâÀßÄê¤Ç¤¤ë¤«¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
+では、実効ユーザ ID を実ユーザ ID もしくは保存 set-user-ID と
+同じ値にすることができるが、
+非特権プロセスが実ユーザ ID を実ユーザ ID、実効ユーザ ID、
+保存 set-user-ID のどの値にも設定できるかは規定されていない。
.\"O For
.\"O .BR setregid (),
.\"O the real group ID can be changed to the value of the saved set-group-ID,
.\"O and the effective group ID can be changed to the value of
.\"O the real group ID or the saved set-group-ID.
.BR setregid ()
-¤Ç¤Ï¡¢¼Â¥°¥ë¡¼¥× ID ¤òÊݸ set-group-ID ¤ÈƱ¤¸ÃͤËÊѹ¹¤Ç¤¡¢
-¼Â¸ú¥°¥ë¡¼¥× ID ¤ò¼Â¥°¥ë¡¼¥× ID ¤äÊݸ set-group-ID ¤ÈƱ¤¸ÃͤËÊѹ¹¤Ç¤¤ë¡£
+では、実グループ ID を保存 set-group-ID と同じ値に変更でき、
+実効グループ ID を実グループ ID や保存 set-group-ID と同じ値に変更できる。
.\"O The precise details of what ID changes are permitted vary
.\"O across implementations.
-¤É¤Î¤è¤¦¤Ê ID ¤ÎÊѹ¹¤¬Ç§¤á¤é¤ì¤Æ¤¤¤ë¤«¤ÎÀµ³Î¤Ê¾ÜºÙ¤Ï
-¼ÂÁõ¤´¤È¤Ë°Û¤Ê¤ë¡£
+どのような ID の変更が認められているかの正確な詳細は
+実装ごとに異なる。
.\"O POSIX.1 makes no specification about the effect of these calls
.\"O on the saved set-user-ID and saved set-group-ID.
-POSIX.1 ¤Ç¤Ï¡¢¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Êݸ set-user-ID ¤ä
-Êݸ set-group-ID ¤ËÍ¿¤¨¤ë±Æ¶Á¤Ë¤Ä¤¤¤Æ¤Ïµ¬Äꤷ¤Æ¤¤¤Ê¤¤¡£
+POSIX.1 では、これらのシステムコールが保存 set-user-ID や
+保存 set-group-ID に与える影響については規定していない。
.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
+.SH 関連項目
.BR getgid (2),
.BR getuid (2),
.BR seteuid (2),