OSDN Git Service

(split) Convert contrib and obsolete pages to UTF-8.
[linuxjm/LDP_man-pages.git] / obsolete / man2 / setregid.2
1 .\" Copyright (c) 1983, 1991 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)setregid.2  6.4 (Berkeley) 3/10/91
33 .\"
34 .\" Modified Sat Jul 24 09:08:49 1993 by Rik Faith (faith@cs.unc.edu)
35 .\" Portions extracted from linux/kernel/sys.c:
36 .\"             Copyright (C) 1991, 1992  Linus Torvalds
37 .\"             May be distributed under the GNU General Public License
38 .\" Changes: Fri Jul 29 10:56:01 BST 1994 by Wilf. <G.Wilford@ee.surrey.ac.uk>
39 .\"          Tue Aug  2 14:56:48 BST 1994 by Wilf due to changes in kernel.
40 .\"
41 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
42 .\"         all rights reserved.
43 .\" Translated Sat Mar  1 16:43:07 JST 1997
44 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
45 .\"
46 .\"WORD:        effective group ID      実効グループID
47 .\"WORD:        real group ID           実グループID
48 .\"WORD:        saved group ID          保存グループID
49 .\"WORD:        super-user              スーパー・ユーザー
50 .\"
51 .TH SETREGID 2 "2nd August 1994" "Linux 1.1.38" "Linux Programmer's Manual"
52 .SH 名前
53 setregid, setegid \- 実(real) と 実効(effective)グループID を設定する
54 .SH 書式
55 .B #include <sys/types.h>
56 .br
57 .B #include <unistd.h>
58 .sp
59 .BI "int setregid(gid_t " rgid ", gid_t " egid );
60 .br
61 .BI "int setegid(gid_t " egid );
62 .SH 説明
63 .B setregid
64 は現在のプロセスの実(real)グループID と 実効(effective)グループID を
65 設定する。非特権ユーザーが実グループID を実効グループID に変化させた
66 りできる。
67
68 Linux 1.1.38 より前は、
69 .B setregid 
70
71 .B setegid
72 が使用する保存(saved)グループID パラダイムは壊れている。
73 1.1.38 から、保存グループIDから実効グループID を設定することが
74 可能になった。
75
76 スーパー・ユーザーのみが他の変更ができる。
77
78 実グループID や実効グループID に \-1 を与えた場合は、
79 システムはその ID を変更しない。
80
81 現在(ibc-4.x.x)では、
82 .BI setegid( egid )       
83 は機能的に
84 .BI setregid(  -1  , " egid" )
85 と等価である。
86
87 もし実グループID が変更されたり、実効グループID が前の実グループID と
88 異った値に設定された場合、保存グループIDには新しい実効グループIDの値が
89 設定される。
90 .SH 返り値
91 成功した場合、ゼロが返される。エラーの場合は \-1 が返され、
92 .I errno
93 が適切に設定される。
94 .SH エラー
95 .TP
96 .TP
97 .B EPERM
98 現在のプロセスがスーパー・ユーザーでなく、変更が
99 (i) 実効グループID と 実グループID を入れ換える。
100 (ii) 片方の値を他方に設定する。
101 (iii) 実効グループID に保存グループID の値を設定する。
102 のいずれでもない。
103
104 .SH 準拠
105 BSD 4.3 (
106 .B setregid
107 関数コールは BSD 4.2 で現れた。)
108 .SH 関連項目
109 .BR getgid (2),
110 .BR setgid (2)