OSDN Git Service

(split) LDP: Update draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / setfsuid.2
1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Created   1995-08-06 Thomas K. Dyas <tdyas@eden.rutgers.edu>
26 .\" Modified  2000-07-01 aeb
27 .\" Modified  2002-07-23 aeb
28 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
29 .\"     Added notes on capability requirements
30 .\"
31 .\"*******************************************************************
32 .\"
33 .\" This file was generated with po4a. Translate the source file.
34 .\"
35 .\"*******************************************************************
36 .\"
37 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
38 .\"         all rights reserved.
39 .\" Translated Sat Mar  1 00:55:10 JST 1997
40 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
41 .\" Modified Mon Sep 23 21:15:17 JST 2000
42 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
43 .\" Modified 2002-09-24 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
44 .\" Modified 2005-02-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
45 .\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
46 .\"
47 .TH SETFSUID 2 2013\-08\-08 Linux "Linux Programmer's Manual"
48 .SH 名前
49 setfsuid \- ファイルシステムのチェックに用いられるユーザ ID を設定する
50 .SH 書式
51 \fB#include <sys/fsuid.h>\fP
52 .sp
53 \fBint setfsuid(uid_t \fP\fIfsuid\fP\fB);\fP
54 .SH 説明
55 The system call \fBsetfsuid\fP()  changes the value of the caller's filesystem
56 user ID\(emthe user ID that the Linux kernel uses to check for all accesses
57 to the filesystem.  Normally, the value of the filesystem user ID will
58 shadow the value of the effective user ID.  In fact, whenever the effective
59 user ID is changed, the filesystem user ID will also be changed to the new
60 value of the effective user ID.
61
62 通常、 \fBsetfsuid\fP()  や \fBsetfsgid\fP() を明示的に呼び出すのは、Linux NFS サーバー のように、
63 ファイルアクセスに用いるユーザID / グループID を変更しなければならないが、 対応する実(real)/実効(effective) ユーザID /
64 グループID は変更したくないような プログラムに限られる。 NFS サーバーのようなプログラムで、通常のユーザID を変更すると、
65 プロセスを望まないシグナルにさらす可能性があり、 セキュリティホールになる。(下記参照)
66
67 \fBsetfsuid\fP()  will succeed only if the caller is the superuser or if
68 \fIfsuid\fP matches either the caller's real user ID, effective user ID, saved
69 set\-user\-ID, or current filesystem user ID.
70 .SH 返り値
71 On both success and failure, this call returns the previous filesystem user
72 ID of the caller.
73 .SH バージョン
74 .\" This system call is present since Linux 1.1.44
75 .\" and in libc since libc 4.7.6.
76 このシステムコールはバージョン 1.2 以降の Linux に存在する。
77 .SH 準拠
78 \fBsetfsuid\fP()  は Linux 特有であり、移植を想定したプログラムで使用してはいけない。
79 .SH 注意
80 glibc が引き数がユーザID として不正だと判断した場合は、 システムコールを行わず \fIerrno\fP に \fBEINVAL\fP を設定して \-1
81 が返される。
82 .LP
83 At the time when this system call was introduced, one process could send a
84 signal to another process with the same effective user ID.  This meant that
85 if a privilged process changed its effective user ID for the purpose of file
86 permission checking, then it could become vulnerable to receiving signals
87 sent by another (unprivileged) process with the same user ID.  The
88 filesystem user ID attribute was thus added to allow a process to change its
89 user ID for the purposes of file permission checking without at the same
90 time becoming vulnerable to receiving unwanted signals.  Since Linux 2.0,
91 signal permission handling is different (see \fBkill\fP(2)), with the result
92 that a process change can change its effective user ID without being
93 vulnerable to receiving signals from unwanted processes.  Thus,
94 \fBsetfsuid\fP()  is nowadays unneeded and should be avoided in new
95 applications (likewise for \fBsetfsgid\fP(2)).
96
97 元々の Linux の \fBsetfsuid\fP() システムコールは
98 16 ビットのグループ ID だけに対応していた。
99 その後、Linux 2.4 で、32 ビットの ID に対応した
100 \fBsetfsuid32\fP() が追加された。
101 glibc の \fBsetfsuid\fP() のラッパー関数は
102 カーネルバージョンによるこの違いを吸収している。
103 .SH バグ
104 No error indications of any kind are returned to the caller, and the fact
105 that both successful and unsuccessful calls return the same value makes it
106 impossible to directly determine whether the call succeeded or failed.
107 Instead, the caller must resort to looking at the return value from a
108 further call such as \fIsetfsuid(\-1)\fP (which will always fail), in order to
109 determine if a preceding call to \fBsetfsuid\fP()  changed the filesystem user
110 ID.  At the very least, \fBEPERM\fP should be returned when the call fails
111 (because the caller lacks the \fBCAP_SETUID\fP capability).
112 .SH 関連項目
113 \fBkill\fP(2), \fBsetfsgid\fP(2), \fBcapabilities\fP(7), \fBcredentials\fP(7)
114 .SH この文書について
115 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
116 である。プロジェクトの説明とバグ報告に関する情報は
117 http://www.kernel.org/doc/man\-pages/ に書かれている。