OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / setfsgid.2
1 .\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Created   1995-08-06 Thomas K. Dyas <tdyas@eden.rutgers.edu>
24 .\" Modified  2000-07-01 aeb
25 .\" Modified  2002-07-23 aeb
26 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
27 .\"     Added notes on capability requirements
28 .\"
29 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
30 .\"         all rights reserved.
31 .\" Translated Sat Mar  1 00:54:23 JST 1997
32 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
33 .\" Modified Mon Sep 23 21:21:54 JST 2000
34 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
35 .\" Modified 2002-09-24 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
36 .\" Modified 2005-02-24, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
37 .\"
38 .\"WORD:        identity                ID
39 .\"WORD:        kernel                  ¥«¡¼¥Í¥ë
40 .\"WORD:        file system             ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à
41 .\"WORD:        effective group ID      ¼Â¸ú¥°¥ë¡¼¥×ID
42 .\"WORD:        real group ID           ¼Â¥°¥ë¡¼¥×ID
43 .\"WORD:        signal                  ¥·¥°¥Ê¥ë
44 .\"WORD:        security hole           ¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë
45 .\"WORD:        saved set-group-ID      Êݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID
46 .\"
47 .TH SETFSGID 2 2008-12-05 "Linux" "Linux Programmer's Manual"
48 .\"O .SH NAME
49 .\"O setfsgid \- set group identity used for file system checks
50 .SH Ì¾Á°
51 setfsgid \- ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Î¥Á¥§¥Ã¥¯¤ËÍѤ¤¤é¤ì¤ë¥°¥ë¡¼¥× ID ¤òÀßÄꤹ¤ë
52 .\"O .SH SYNOPSIS
53 .SH ½ñ¼°
54 .B #include <unistd.h>
55 /* glibc ¤Ç¤Ï <sys/fsuid.h> */
56 .sp
57 .BI "int setfsgid(uid_t " fsgid );
58 .\"O .SH DESCRIPTION
59 .SH ÀâÌÀ
60 .\"O The system call
61 .\"O .BR setfsgid ()
62 .\"O sets the group ID that the Linux kernel uses to check for all accesses
63 .\"O to the file system.
64 .\"O Normally, the value of
65 .\"O .I fsgid
66 .\"O will shadow the value of the effective group ID.
67 .\"O In fact, whenever the
68 .\"O effective group ID is changed,
69 .\"O .I fsgid
70 .\"O will also be changed to the new value of the effective group ID.
71 ¥·¥¹¥Æ¥à¥³¡¼¥ë
72 .BR setfsgid ()
73 ¤Ï Linux ¥«¡¼¥Í¥ë¤¬¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤ËÂФ¹¤ë
74 Á´¤Æ¤Î¥¢¥¯¥»¥¹¤Î¥Á¥§¥Ã¥¯¤Ë»ÈÍѤ¹¤ë¥°¥ë¡¼¥× ID¤òÀßÄꤹ¤ë¡£Ä̾ï¤Ï
75 .I fsgid
76 ¤ÎÃͤϼ¸ú (effective) ¥°¥ë¡¼¥×ID ¤ÈƱ¤¸¤Ë¤Ê¤ë¡£¼ÂºÝ¡¢
77 ¼Â¸ú¥°¥ë¡¼¥× ID ¤¬Êѹ¹¤µ¤ì¤ëÅÙ¤Ë
78 .I fsgid
79 ¤â¤Þ¤¿¿·¤·¤¤¼Â¸ú¥°¥ë¡¼¥×ID ¤ÎÃͤËÊѹ¹¤µ¤ì¤ë¡£
80
81 .\"O Explicit calls to
82 .\"O .BR setfsuid (2)
83 .\"O and
84 .\"O .BR setfsgid ()
85 .\"O are usually only used by programs such as the Linux NFS server that
86 .\"O need to change what user and group ID is used for file access without a
87 .\"O corresponding change in the real and effective user and group IDs.
88 .\"O A change in the normal user IDs for a program such as the NFS server
89 .\"O is a security hole that can expose it to unwanted signals.
90 .\"O (But see below.)
91 Ä̾
92 .BR setfsuid ()
93 ¤ä
94 .BR setfsgid ()
95 ¤¬ÌÀ¼¨Åª¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¤Î¤Ï¡¢Linux NFS ¥µ¡¼¥Ð¡¼ ¤Î¤è¤¦¤Ë¡¢
96 ¥Õ¥¡¥¤¥ë¡¦¥¢¥¯¥»¥¹¤ËÍѤ¤¤ë¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤òÊѹ¹¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤¬¡¢
97 Âбþ¤¹¤ë¼Â(real)/¼Â¸ú(effective) ¥æ¡¼¥¶ID / ¥°¥ë¡¼¥×ID ¤ÏÊѹ¹¤·¤¿¤¯¤Ê¤¤¤è¤¦¤Ê
98 ¥×¥í¥°¥é¥à¤Ë¸Â¤é¤ì¤ë¡£
99 NFS ¥µ¡¼¥Ð¡¼¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¡¢Ä̾ï¤Î¥æ¡¼¥¶ID ¤òÊѹ¹¤¹¤ë¤È¡¢
100 ¥×¥í¥»¥¹¤ò˾¤Þ¤Ê¤¤¥·¥°¥Ê¥ë¤Ë¤µ¤é¤¹²ÄǽÀ­¤¬¤¢¤ê¡¢
101 ¥»¥­¥å¥ê¥Æ¥£¡¦¥Û¡¼¥ë¤Ë¤Ê¤ë¡£(²¼µ­»²¾È)
102
103 .\"O .BR setfsgid ()
104 .\"O will only succeed if the caller is the superuser or if
105 .\"O .I fsgid
106 .\"O matches either the real group ID, effective group ID,
107 .\"O saved set-group-ID, or the current value of
108 .\"O .IR fsgid .
109 .BR setfsgid ()
110 ¤Ï¡¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤«¡¢
111 .I fsgid
112 ¤¬¼Â¥°¥ë¡¼¥×ID¡¢¼Â¸ú¥°¥ë¡¼¥×ID¡¢
113 Êݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID (saved set-group-ID)¡¢¸½ºß¤Î
114 .I fsgid
115 ¤ÎÃͤΤ¤¤º¤ì¤«¤Ë°ìÃפ¹¤ë¾ì¹ç¤Ë¤Î¤ßÀ®¸ù¤¹¤ë¡£
116 .\"O .SH "RETURN VALUE"
117 .SH ÊÖ¤êÃÍ
118 .\"O On success, the previous value of
119 .\"O .I fsgid
120 .\"O is returned.
121 .\"O On error, the current value of
122 .\"O .I fsgid
123 .\"O is returned.
124 À®¸ù¤·¤¿¾ì¹ç¡¢
125 .I fsgid
126 ¤Î°ÊÁ°¤ÎÃͤòÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï
127 .I fsgid
128 ¤Î¸½ºß¤ÎÃͤòÊÖ¤¹¡£
129 .\"O .SH VERSIONS
130 .SH ¥Ð¡¼¥¸¥ç¥ó
131 .\"O This system call is present in Linux since version 1.2.
132 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 1.2 °Ê¹ß¤Î Linux ¤Ë¸ºß¤¹¤ë¡£
133 .\" This system call is present since Linux 1.1.44
134 .\" and in libc since libc 4.7.6.
135 .\"O .SH "CONFORMING TO"
136 .SH ½àµò
137 .\"O .BR setfsgid ()
138 .\"O is Linux-specific and should not be used in programs intended
139 .\"O to be portable.
140 .BR setfsgid ()
141 ¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤òÁÛÄꤷ¤¿¥×¥í¥°¥é¥à¤Ç»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
142 .\"O .SH NOTES
143 .SH Ãí°Õ
144 .\"O When glibc determines that the argument is not a valid group ID,
145 .\"O it will return \-1 and set \fIerrno\fP to
146 .\"O .B EINVAL
147 .\"O without attempting
148 .\"O the system call.
149 glibc ¤¬°ú¤­¿ô¤¬¥°¥ë¡¼¥×ID ¤È¤·¤ÆÉÔÀµ¤À¤ÈȽÃǤ·¤¿¾ì¹ç¤Ï¡¢
150 ¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤ò¹Ô¤ï¤º \fIerrno\fP ¤Ë
151 .B EINVAL
152 ¤òÀßÄꤷ¤Æ \-1 ¤¬ÊÖ¤µ¤ì¤ë¡£
153 .LP
154 .\"O Note that at the time this system call was introduced, a process
155 .\"O could send a signal to a process with the same effective user ID.
156 .\"O Today signal permission handling is slightly different.
157 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Æ³Æþ¤µ¤ì¤¿Åö»þ¡¢¥×¥í¥»¥¹¤Ï
158 Ʊ¤¸¼Â¸ú¥æ¡¼¥¶ID¤Î¥×¥í¥»¥¹¤Ø¥·¥°¥Ê¥ë¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤¿¡£
159 º£Æü¤Ç¤Ï¡¢¥·¥°¥Ê¥ëÁ÷¿®¸¢¸Â¤Î°·¤¤¤Ï¤«¤Ê¤ê°ã¤¦¤â¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
160 .\"O .SH BUGS
161 .SH ¥Ð¥°
162 .\"O No error messages of any kind are returned to the caller.
163 .\"O At the very
164 .\"O least,
165 .\"O .B EPERM
166 .\"O should be returned when the call fails (because the caller lacks the
167 .\"O .B CAP_SETGID
168 .\"O capability).
169 ¤¤¤«¤Ê¤ë¼ïÎà¤Î¥¨¥é¡¼¡¦¥á¥Ã¥»¡¼¥¸¤âÊÖ¤µ¤Ê¤¤¡£
170 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï (¸Æ¤Ó½Ð¤·¸µ¤Ë¤Ï
171 .B CAP_SETGID
172 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤«¤Ã¤¿¤Î¤À¤«¤é) ºÇÄã¤Ç¤â
173 .B EPERM
174 ¤¯¤é¤¤¤ÏÊÖ¤¹¤Ù¤­¤Ç¤¢¤ë¡£
175 .\"O .SH "SEE ALSO"
176 .SH ´ØÏ¢¹àÌÜ
177 .BR kill (2),
178 .BR setfsuid (2),
179 .BR capabilities (7),
180 .BR credentials (7)