OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man2 / setgid.2
1 .\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
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 .\" Fri Jul 29th 12:56:44 BST 1994  Wilf. <G.Wilford@ee.surrey.ac.uk>
24 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
25 .\" Modified 2002-03-09 by aeb
26 .\"
27 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
28 .\"         all rights reserved.
29 .\" Translated Sat Mar  1 16:31:56 JST 1997
30 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
31 .\" Updated Fri Feb  7 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
32 .\"
33 .\"WORD:        identity                ¼±ÊÌ
34 .\"WORD:        effective group ID      ¼Â¸ú¥°¥ë¡¼¥×ID
35 .\"WORD:        real group ID           ¼Â¥°¥ë¡¼¥×ID
36 .\"WORD:        saved set-group-ID      Êݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID
37 .\"WORD:        implement               ¼ÂÁõ
38 .\"WORD:        superuser               ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼
39 .\"
40 .TH SETGID 2 2009-10-17 "Linux" "Linux Programmer's Manual"
41 .\"O .SH NAME
42 .SH Ì¾Á°
43 .\"O setgid \- set group identity
44 setgid \- ¥°¥ë¡¼¥×¼±ÊÌ(identity)¤òÀßÄꤹ¤ë
45 .\"O .SH SYNOPSIS
46 .SH ½ñ¼°
47 .B #include <sys/types.h>
48 .br
49 .B #include <unistd.h>
50 .sp
51 .BI "int setgid(gid_t " gid );
52 .\"O .SH DESCRIPTION
53 .SH ÀâÌÀ
54 .\"O .BR setgid ()
55 .\"O sets the effective group ID of the calling process.
56 .\"O If the caller is the
57 .\"O superuser, the real GID and saved set-group-ID are also set.
58 .BR setgid ()
59 ¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¸ú (effective) ¥°¥ë¡¼¥×ID ¤òÀßÄꤹ¤ë¡£
60 ¤â¤·¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ï¡¢
61 ¼Â (real) ¥°¥ë¡¼¥×ID ¤ÈÊݸ (saved) set-group-ID ¤âÀßÄꤵ¤ì¤ë¡£
62
63 .\"O Under Linux,
64 .\"O .BR setgid ()
65 .\"O is implemented like the POSIX version with the
66 .\"O .B _POSIX_SAVED_IDS
67 .\"O feature.
68 .\"O This allows a set-group-ID program that is not set-user-ID-root
69 .\"O to drop all of its group
70 .\"O privileges, do some un-privileged work, and then reengage the original
71 .\"O effective group ID in a secure manner.
72 Linux ¤Ë¤ª¤¤¤Æ¡¢
73 .BR setgid ()
74 ¤Ï
75 .B _POSIX_SAVED_IDS
76 ¤ò¤â¤Ã¤¿ POSIX ÈǤΤ褦¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
77 ¤³¤ì¤Ï set-user-ID-root ¤Ç¤Ê¤¤ set-group-ID ¥×¥í¥°¥é¥à¤Ë¤½¤Î¥°¥ë¡¼¥×¤Î
78 Æø¢¤ÎÁ´¤ÆÍî¤È¤·¡¢Æø¢¤ÎɬÍפʤ¤»Å»ö¤ò¤·¡¢ËÜÍè¤Î¼Â¸ú¥°¥ë¡¼¥×ID ¤Ë
79 °ÂÁ´¤ÊÊýË¡¤ÇºÆ¤ÓÌ᤹¤³¤È¤òµö¤¹¡£
80 .\"O .SH "RETURN VALUE"
81 .SH ÊÖ¤êÃÍ
82 .\"O On success, zero is returned.
83 .\"O On error, \-1 is returned, and
84 .\"O .I errno
85 .\"O is set appropriately.
86 À®¸ù¤·¤¿¾ì¹ç¤Ï¥¼¥í¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
87 .I errno
88 ¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
89 .\"O .SH ERRORS
90 .SH ¥¨¥é¡¼
91 .TP
92 .B EPERM
93 .\"O The calling process is not privileged (does not have the
94 .\"O \fBCAP_SETGID\fP capability), and
95 .\"O .I gid
96 .\"O does not match the real group ID or saved set-group-ID of
97 .\"O the calling process.
98 ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Ë¸¢¸Â¤¬¤Ê¤¯ (\fBCAP_SETGID\fP ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬¤Ê¤¯)¡¢¤«¤Ä
99 .I gid
100 ¤¬¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥×ID ¤ÈÊݸ¥»¥Ã¥È¥°¥ë¡¼¥×ID
101 ¤Î¤É¤Á¤é¤È¤â°ìÃפ·¤Ê¤¤¡£
102 .\"O .SH "CONFORMING TO"
103 .SH ½àµò
104 SVr4, POSIX.1-2001.
105 .\"O .SH "SEE ALSO"
106 .SH ´ØÏ¢¹àÌÜ
107 .BR getgid (2),
108 .BR setegid (2),
109 .BR setregid (2),
110 .BR capabilities (7),
111 .BR credentials (7)