OSDN Git Service

info/GNU_which: Add some explanations.
[linuxjm/jm.git] / manual / LDP_man-pages / release / man2 / setfsgid.2
1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2 .\" and Copyright (C) 2019, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\" Created   1995-08-06 Thomas K. Dyas <tdyas@eden.rutgers.edu>
27 .\" Modified  2000-07-01 aeb
28 .\" Modified  2002-07-23 aeb
29 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
30 .\"     Added notes on capability requirements
31 .\"
32 .\"*******************************************************************
33 .\"
34 .\" This file was generated with po4a. Translate the source file.
35 .\"
36 .\"*******************************************************************
37 .\"
38 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
39 .\"         all rights reserved.
40 .\" Translated Sat Mar  1 00:54:23 JST 1997
41 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
42 .\" Modified Mon Sep 23 21:21:54 JST 2000
43 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
44 .\" Modified 2002-09-24 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
45 .\" Modified 2005-02-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
46 .\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
47 .\"
48 .TH SETFSGID 2 2019\-05\-09 Linux "Linux Programmer's Manual"
49 .SH 名前
50 setfsgid \- ファイルシステムのチェックに用いられるグループ ID を設定する
51 .SH 書式
52 \fB#include <sys/fsuid.h>\fP
53 .PP
54 \fBint setfsgid(uid_t \fP\fIfsgid\fP\fB);\fP
55 .SH 説明
56 On Linux, a process has both a filesystem group ID and an effective group
57 ID.  The (Linux\-specific) filesystem group ID is used for permissions
58 checking when accessing filesystem objects, while the effective group ID is
59 used for some other kinds of permissions checks (see \fBcredentials\fP(7)).
60 .PP
61 Normally, the value of the process's filesystem group ID is the same as the
62 value of its effective group ID.  This is so, because whenever a process's
63 effective group ID is changed, the kernel also changes the filesystem group
64 ID to be the same as the new value of the effective group ID.  A process can
65 cause the value of its filesystem group ID to diverge from its effective
66 group ID by using \fBsetfsgid\fP()  to change its filesystem group ID to the
67 value given in \fIfsgid\fP.
68 .PP
69 \fBsetfsgid\fP()  は、スーパーユーザーによって呼び出された場合か、 \fIfsgid\fP が呼び出し元の実グループID、実効グループID、
70 保存セットグループID (saved set\-group\-ID)、現在のファイルシステムグループ ID の値のいずれかに一致する場合にのみ成功する。
71 .SH 返り値
72 成功時も失敗時も、 この呼び出しは直前の呼び出し元のファイルシステムグループ ID の値を返す。
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 The filesystem group ID concept and the \fBsetfsgid\fP()  system call were
81 invented for historical reasons that are no longer applicable on modern
82 Linux kernels.  See \fBsetfsuid\fP(2)  for a discussion of why the use of both
83 \fBsetfsuid\fP(2)  and \fBsetfsgid\fP()  is nowadays unneeded.
84 .PP
85 元々の Linux の \fBsetfsgid\fP() システムコールは
86 16 ビットのグループ ID だけに対応していた。
87 その後、Linux 2.4 で、32 ビットの ID に対応した
88 \fBsetfsgid32\fP() が追加された。
89 glibc の \fBsetfsgid\fP() のラッパー関数は
90 カーネルバージョンによるこの違いを吸収している。
91 .SS "C ライブラリとカーネルの違い"
92 In glibc 2.15 and earlier, when the wrapper for this system call determines
93 that the argument can't be passed to the kernel without integer truncation
94 (because the kernel is old and does not support 32\-bit group IDs), it will
95 return \-1 and set \fIerrno\fP to \fBEINVAL\fP without attempting the system call.
96 .SH バグ
97 いかなる種類のエラーメッセージも返さず、 成功した場合も失敗した場合も呼び出しは同じ値を返すため、
98 呼び出しが成功したか失敗したかを直接判定することはできない。 その代わり、 直前の \fBsetfsgid\fP() の呼び出しがファイルシステムグループ
99 ID を変更したかどうかを判定するために、 呼び出し元はこの後に \fIsetfsgid(\-1)\fP などを呼び出して返り値を見なければならない
100 (\fIsetfsgid(\-1)\fP は常に失敗する)。 最低でも、失敗した場合は \fBEPERM\fP くらいは返すべきである (呼び出し元には
101 \fBCAP_SETGID\fP ケーパビリティがなかったのだから)。
102 .SH 関連項目
103 \fBkill\fP(2), \fBsetfsuid\fP(2), \fBcapabilities\fP(7), \fBcredentials\fP(7)
104 .SH この文書について
105 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
106 \%https://www.kernel.org/doc/man\-pages/ に書かれている。