1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
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.
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.
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
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
27 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
28 .\" all rights reserved.
29 .\" Translated 1997-08-30, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
30 .\" Updated & Modified 2004-05-22, Yuichi SATO <ysato444@yahoo.co.jp>
31 .\" Updated & Modified 2005-01-04, Yuichi SATO
32 .\" Updated & Modified 2005-09-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
33 .\" Updated & Modified 2005-11-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
35 .\"WORD: effective user ID 実効ユーザーID
36 .\"WORD: real user ID 実ユーザーID
37 .\"WORD: saved set-user-ID 保存セットユーザーID
38 .\"WORD: effective group ID 実効グループID
39 .\"WORD: real group ID 実グループID
40 .\"WORD: saved group ID 保存グループID
42 .TH SETRESUID 2 2007-07-26 "Linux" "Linux Programmer's Manual"
44 setresuid, setresgid \- ユーザやグループの 実、実効、保存 ID を設定する
46 .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */"
48 .B #include <unistd.h>
50 .BI "int setresuid(uid_t " ruid ", uid_t " euid ", uid_t " suid );
52 .BI "int setresgid(gid_t " rgid ", gid_t " egid ", gid_t " sgid );
55 は呼び出し元のプロセスの実 (real) ユーザーID、実効 (effective) ユーザーID、
58 非特権ユーザーのプロセスは、その実 UID、実効 UID、保存 set-user-ID を、
59 現在の実 UID、現在の実効 UID、現在の保存 set-user-ID
62 特権プロセス (Linux では \fBCAP_SETUID\fP ケーパビリティ (capability) を持つ
63 プロセス) は、実 UID、実効 UID、保存 set-user-ID を任意の値に設定できる。
65 引き数のどれかが \-1 の場合はその値は変更されずに残される。
67 実 UID、実効 UID、保存 set-user-ID にどんな変更が行われたかに関わらず、
68 ファイルシステム UID は常に実効 UID (可能であれば変更後の新しい実効 UID)
73 は呼び出し元のプロセスの実 GID、実効 GID、保存 set-group-ID を設定する
74 (さらにファイルシステム GID を実効 GID と同じ値に修正する)。
77 成功した場合は 0 が返される。エラーの場合は \-1 が返され、
92 (\fBCAP_SETUID\fP ケーパビリティを持たないのに)、
93 ID を許されていない値に変更しようとした。
95 Linux ではバージョン 2.1.44 より利用可能になった。
98 HP-UX や BSD 系のいくつかにも存在する。
103 Linux では、glibc 2.3.2 以降で
112 .BR capabilities (7),