1 .\" Copyright (c) 1983, 1991 The Regents of the University of California.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
32 .\" @(#)setregid.2 6.4 (Berkeley) 3/10/91
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.
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>
46 .\"WORD: effective group ID 実効グループID
47 .\"WORD: real group ID 実グループID
48 .\"WORD: saved group ID 保存グループID
49 .\"WORD: super-user スーパー・ユーザー
51 .TH SETREGID 2 "2nd August 1994" "Linux 1.1.38" "Linux Programmer's Manual"
53 setregid, setegid \- 実(real) と 実効(effective)グループID を設定する
55 .B #include <sys/types.h>
57 .B #include <unistd.h>
59 .BI "int setregid(gid_t " rgid ", gid_t " egid );
61 .BI "int setegid(gid_t " egid );
64 は現在のプロセスの実(real)グループID と 実効(effective)グループID を
65 設定する。非特権ユーザーが実グループID を実効グループID に変化させた
72 が使用する保存(saved)グループID パラダイムは壊れている。
73 1.1.38 から、保存グループIDから実効グループID を設定することが
78 実グループID や実効グループID に \-1 を与えた場合は、
84 .BI setregid( -1 , " egid" )
87 もし実グループID が変更されたり、実効グループID が前の実グループID と
88 異った値に設定された場合、保存グループIDには新しい実効グループIDの値が
91 成功した場合、ゼロが返される。エラーの場合は \-1 が返され、
98 現在のプロセスがスーパー・ユーザーでなく、変更が
99 (i) 実効グループID と 実グループID を入れ換える。
101 (iii) 実効グループID に保存グループID の値を設定する。
107 関数コールは BSD 4.2 で現れた。)