OSDN Git Service

(split) LDP: Update draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / setfsgid.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:54:23 JST 1997
40 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
41 .\" Modified Mon Sep 23 21:21:54 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 SETFSGID 2 2013\-08\-08 Linux "Linux Programmer's Manual"
48 .SH 名前
49 setfsgid \- ファイルシステムのチェックに用いられるグループ ID を設定する
50 .SH 書式
51 \fB#include <sys/fsuid.h>\fP
52 .sp
53 \fBint setfsgid(uid_t \fP\fIfsgid\fP\fB);\fP
54 .SH 説明
55 The system call \fBsetfsgid\fP()  changes the value of the caller's filesystem
56 group ID\(emthe group ID that the Linux kernel uses to check for all
57 accesses to the filesystem.  Normally, the value of the filesystem group ID
58 will shadow the value of the effective group ID.  In fact, whenever the
59 effective group ID is changed, the filesystem group ID will also be changed
60 to the new value of the effective group ID.
61
62 通常、 \fBsetfsuid\fP()  や \fBsetfsgid\fP() を明示的に呼び出すのは、Linux NFS サーバー のように、
63 ファイルアクセスに用いるユーザID / グループID を変更しなければならないが、 対応する実(real)/実効(effective) ユーザID /
64 グループID は変更したくないような プログラムに限られる。 NFS サーバーのようなプログラムで、通常のユーザID を変更すると、
65 プロセスを望まないシグナルにさらす可能性があり、 セキュリティホールになる。(下記参照)
66
67 \fBsetfsgid\fP()  will succeed only if the caller is the superuser or if
68 \fIfsgid\fP matches either the caller's real group ID, effective group ID,
69 saved set\-group\-ID, or current the filesystem user ID.
70 .SH 返り値
71 On both success and failure, this call returns the previous filesystem group
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 \fBsetfsgid\fP()  は Linux 特有であり、移植を想定したプログラムで使用してはいけない。
79 .SH 注意
80 glibc が引き数がグループID として不正だと判断した場合は、 システムコールを行わず \fIerrno\fP に \fBEINVAL\fP を設定して \-1
81 が返される。
82 .LP
83 Note that at the time this system call was introduced, a process could send
84 a signal to a process with the same effective user ID.  Today signal
85 permission handling is slightly different.  See \fBsetfsuid\fP(2)  for a
86 discussion of why the use of both \fBsetfsuid\fP(2)  and \fBsetfsgid\fP()  is
87 nowadays unneeded.
88
89 元々の Linux の \fBsetfsgid\fP() システムコールは
90 16 ビットのグループ ID だけに対応していた。
91 その後、Linux 2.4 で、32 ビットの ID に対応した
92 \fBsetfsgid32\fP() が追加された。
93 glibc の \fBsetfsgid\fP() のラッパー関数は
94 カーネルバージョンによるこの違いを吸収している。
95 .SH バグ
96 No error indications of any kind are returned to the caller, and the fact
97 that both successful and unsuccessful calls return the same value makes it
98 impossible to directly determine whether the call succeeded or failed.
99 Instead, the caller must resort to looking at the return value from a
100 further call such as \fIsetfsgid(\-1)\fP (which will always fail), in order to
101 determine if a preceding call to \fBsetfsgid\fP()  changed the filesystem group
102 ID.  At the very least, \fBEPERM\fP should be returned when the call fails
103 (because the caller lacks the \fBCAP_SETGID\fP capability).
104 .SH 関連項目
105 \fBkill\fP(2), \fBsetfsuid\fP(2), \fBcapabilities\fP(7), \fBcredentials\fP(7)
106 .SH この文書について
107 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
108 である。プロジェクトの説明とバグ報告に関する情報は
109 http://www.kernel.org/doc/man\-pages/ に書かれている。