OSDN Git Service

(split) LDP: Update release pages
[linuxjm/LDP_man-pages.git] / release / man2 / setfsuid.2
index 697dfa2..0a395c2 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
 .\"
+.\" %%%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.
@@ -19,6 +20,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Created   1995-08-06 Thomas K. Dyas <tdyas@eden.rutgers.edu>
 .\" Modified  2000-07-01 aeb
 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
 .\"     Added notes on capability requirements
 .\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
 .\"         all rights reserved.
 .\" Translated Sat Mar  1 00:55:10 JST 1997
 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
 .\" Modified 2002-09-24 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
 .\" Modified 2005-02-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
 .\"
-.\"WORD:       identity                ID
-.\"WORD:       kernel                  ¥«¡¼¥Í¥ë
-.\"WORD:       file system             ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à
-.\"WORD:       effective user ID       ¼Â¸ú¥æ¡¼¥¶ID
-.\"WORD:       real user ID            ¼Â¥æ¡¼¥¶ID
-.\"WORD:       signal                  ¥·¥°¥Ê¥ë
-.\"WORD:       security hole           ¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë
-.\"WORD:       saved set-user-ID       Êݸ¥»¥Ã¥È¥æ¡¼¥¶ID
-.\"
-.TH SETFSUID 2 2008-12-05 "Linux" "Linux Programmer's Manual"
-.SH Ì¾Á°
-setfsuid \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥Á¥§¥Ã¥¯¤ËÍѤ¤¤é¤ì¤ë¥æ¡¼¥¶ ID ¤òÀßÄꤹ¤ë
-.SH ½ñ¼°
-.B #include <unistd.h>
-/* glibc ¤Ç¤Ï <sys/fsuid.h> */
+.TH SETFSUID 2 2013\-08\-08 Linux "Linux Programmer's Manual"
+.SH 名前
+setfsuid \- ファイルシステムのチェックに用いられるユーザ ID を設定する
+.SH 書式
+\fB#include <sys/fsuid.h>\fP
 .sp
-.BI "int setfsuid(uid_t " fsuid );
-.SH ÀâÌÀ
-.BR setfsuid ()
-¤Ï Linux ¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ËÂФ¹¤ë
-Á´¤Æ¤Î¥¢¥¯¥»¥¹¤Î¥Á¥§¥Ã¥¯¤Ë»ÈÍѤ¹¤ë¥æ¡¼¥¶ID ¤òÀßÄꤹ¤ë¡£Ä̾ï¤Ï
-.I fsuid
-¤ÎÃͤϼ¸ú (effective) ¥æ¡¼¥¶ID ¤ÈƱ¤¸¤Ë¤Ê¤ë¡£¼ÂºÝ¡¢
-¼Â¸ú¥æ¡¼¥¶ID ¤¬Êѹ¹¤µ¤ì¤ëÅÙ¤Ë
-.I fsuid
-¤â¤Þ¤¿¿·¤·¤¤¼Â¸ú¥æ¡¼¥¶ID ¤ÎÃͤËÊѹ¹¤µ¤ì¤ë¡£
+\fBint setfsuid(uid_t \fP\fIfsuid\fP\fB);\fP
+.SH 説明
+The system call \fBsetfsuid\fP()  changes the value of the caller's filesystem
+user ID\(emthe user ID that the Linux kernel uses to check for all accesses
+to the filesystem.  Normally, the value of the filesystem user ID will
+shadow the value of the effective user ID.  In fact, whenever the effective
+user ID is changed, the filesystem user ID will also be changed to the new
+value of the effective user ID.
 
-Ä̾
-.BR setfsuid ()
-¤ä
-.BR setfsgid ()
-¤¬ÌÀ¼¨Åª¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¤Î¤Ï¡¢Linux NFS ¥µ¡¼¥Ð¡¼ ¤Î¤è¤¦¤Ë¡¢
-¥Õ¥¡¥¤¥ë¡¦¥¢¥¯¥»¥¹¤ËÍѤ¤¤ë¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤òÊѹ¹¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤¬¡¢
-Âбþ¤¹¤ë¼Â(real)/¼Â¸ú(effective) ¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤ÏÊѹ¹¤·¤¿¤¯¤Ê¤¤¤è¤¦¤Ê
-¥×¥í¥°¥é¥à¤Ë¸Â¤é¤ì¤ë¡£
-NFS ¥µ¡¼¥Ð¡¼¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¡¢Ä̾ï¤Î¥æ¡¼¥¶ID ¤òÊѹ¹¤¹¤ë¤È¡¢
-¥×¥í¥»¥¹¤ò˾¤Þ¤Ê¤¤¥·¥°¥Ê¥ë¤Ë¤µ¤é¤¹²ÄǽÀ­¤¬¤¢¤ê¡¢
-¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë¤Ë¤Ê¤ë¡£(²¼µ­»²¾È)
+通常、 \fBsetfsuid\fP()  や \fBsetfsgid\fP() を明示的に呼び出すのは、Linux NFS サーバー のように、
+ファイルアクセスに用いるユーザID / グループID を変更しなければならないが、 対応する実(real)/実効(effective) ユーザID /
+グループID は変更したくないような プログラムに限られる。 NFS サーバーのようなプログラムで、通常のユーザID を変更すると、
+プロセスを望まないシグナルにさらす可能性があり、 セキュリティホールになる。(下記参照)
 
-.BR setfsuid ()
-¤Ï¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤«¡¢
-.I fsuid
-¤¬¼Â¥æ¡¼¥¶ID¡¢¼Â¸ú¥æ¡¼¥¶ID¡¢
-Êݸ¥»¥Ã¥È¥æ¡¼¥¶ID (saved set-user-ID)¡¢¸½ºß¤Î
-.I fsuid
-¤ÎÃͤΤ¤¤º¤ì¤«¤Ë°ìÃפ¹¤ë¾ì¹ç¤Ë¤Î¤ßÀ®¸ù¤¹¤ë¡£
-.SH ÊÖ¤êÃÍ
-À®¸ù¤·¤¿¾ì¹ç¡¢
-.I fsuid
-¤Î°ÊÁ°¤ÎÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï
-.I fsuid
-¤Î¸½ºß¤ÎÃͤòÊÖ¤¹¡£
-.SH ¥Ð¡¼¥¸¥ç¥ó
-¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 1.2 °Ê¹ß¤Î Linux ¤Ë¸ºß¤¹¤ë¡£
+\fBsetfsuid\fP()  will succeed only if the caller is the superuser or if
+\fIfsuid\fP matches either the caller's real user ID, effective user ID, saved
+set\-user\-ID, or current filesystem user ID.
+.SH 返り値
+On both success and failure, this call returns the previous filesystem user
+ID of the caller.
+.SH バージョン
 .\" This system call is present since Linux 1.1.44
 .\" and in libc since libc 4.7.6.
-.SH ½àµò
-.BR setfsuid ()
-¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
-.SH Ãí°Õ
-glibc ¤¬°ú¤­¿ô¤¬¥æ¡¼¥¶ID ¤È¤·¤ÆÉÔÀµ¤À¤ÈȽÃǤ·¤¿¾ì¹ç¤Ï¡¢
-¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤ï¤º \fIerrno\fP ¤Ë
-.B EINVAL
-¤òÀßÄꤷ¤Æ \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£
+このシステムコールはバージョン 1.2 以降の Linux に存在する。
+.SH 準拠
+\fBsetfsuid\fP()  は Linux 特有であり、移植を想定したプログラムで使用してはいけない。
+.SH 注意
+glibc が引き数がユーザID として不正だと判断した場合は、 システムコールを行わず \fIerrno\fP に \fBEINVAL\fP を設定して \-1
+が返される。
 .LP
-¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Æ³Æþ¤µ¤ì¤¿Åö»þ¡¢¥×¥í¥»¥¹¤Ï
-Ʊ¤¸¼Â¸ú¥æ¡¼¥¶ID¤Î¥×¥í¥»¥¹¤Ø¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤¿¡£
-º£Æü¤Ç¤Ï¡¢¥·¥°¥Ê¥ëÁ÷¿®¸¢¸Â¤Î°·¤¤¤Ï¤«¤Ê¤ê°ã¤¦¤â¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
-.SH ¥Ð¥°
-¤¤¤«¤Ê¤ë¼ïÎà¤Î¥¨¥é¡¼¡¦¥á¥Ã¥»¡¼¥¸¤â¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤µ¤Ê¤¤¡£
-¼ºÇÔ¤·¤¿¾ì¹ç¤Ï (¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï
-.B CAP_SETUID
-¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤«¤Ã¤¿¤Î¤À¤«¤é) ºÇÄã¤Ç¤â
-.B EPERM
-¤¯¤é¤¤¤ÏÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë¡£
-.SH ´ØÏ¢¹àÌÜ
-.BR kill (2),
-.BR setfsgid (2),
-.BR capabilities (7),
-.BR credentials (7)
+At the time when this system call was introduced, one process could send a
+signal to another process with the same effective user ID.  This meant that
+if a privilged process changed its effective user ID for the purpose of file
+permission checking, then it could become vulnerable to receiving signals
+sent by another (unprivileged) process with the same user ID.  The
+filesystem user ID attribute was thus added to allow a process to change its
+user ID for the purposes of file permission checking without at the same
+time becoming vulnerable to receiving unwanted signals.  Since Linux 2.0,
+signal permission handling is different (see \fBkill\fP(2)), with the result
+that a process change can change its effective user ID without being
+vulnerable to receiving signals from unwanted processes.  Thus,
+\fBsetfsuid\fP()  is nowadays unneeded and should be avoided in new
+applications (likewise for \fBsetfsgid\fP(2)).
+
+元々の Linux の \fBsetfsuid\fP() システムコールは
+16 ビットのグループ ID だけに対応していた。
+その後、Linux 2.4 で、32 ビットの ID に対応した
+\fBsetfsuid32\fP() が追加された。
+glibc の \fBsetfsuid\fP() のラッパー関数は
+カーネルバージョンによるこの違いを吸収している。
+.SH バグ
+No error indications of any kind are returned to the caller, and the fact
+that both successful and unsuccessful calls return the same value makes it
+impossible to directly determine whether the call succeeded or failed.
+Instead, the caller must resort to looking at the return value from a
+further call such as \fIsetfsuid(\-1)\fP (which will always fail), in order to
+determine if a preceding call to \fBsetfsuid\fP()  changed the filesystem user
+ID.  At the very least, \fBEPERM\fP should be returned when the call fails
+(because the caller lacks the \fBCAP_SETUID\fP capability).
+.SH 関連項目
+\fBkill\fP(2), \fBsetfsgid\fP(2), \fBcapabilities\fP(7), \fBcredentials\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。