OSDN Git Service

(split) LDP: Update release pages based on LDP 3.54 release
[linuxjm/LDP_man-pages.git] / release / man2 / setresuid.2
1 .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified, 2003-05-26, Michael Kerrisk, <mtk.manpages@gmail.com>
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .\"
32 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
33 .\"         all rights reserved.
34 .\" Translated 1997-08-30, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
35 .\" Updated & Modified 2004-05-22, Yuichi SATO <ysato444@yahoo.co.jp>
36 .\" Updated & Modified 2005-01-04, Yuichi SATO
37 .\" Updated & Modified 2005-09-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
38 .\" Updated & Modified 2005-11-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
39 .\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
40 .\"
41 .TH SETRESUID 2 2010\-11\-22 Linux "Linux Programmer's Manual"
42 .SH 名前
43 setresuid, setresgid \- ユーザやグループの 実、実効、保存 ID を設定する
44 .SH 書式
45 \fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */
46 .br
47 \fB#include <unistd.h>\fP
48 .sp
49 \fBint setresuid(uid_t \fP\fIruid\fP\fB, uid_t \fP\fIeuid\fP\fB, uid_t \fP\fIsuid\fP\fB);\fP
50 .br
51 \fBint setresgid(gid_t \fP\fIrgid\fP\fB, gid_t \fP\fIegid\fP\fB, gid_t \fP\fIsgid\fP\fB);\fP
52 .SH 説明
53 \fBsetresuid\fP()  は呼び出し元のプロセスの実 (real) ユーザーID、実効 (effective) ユーザーID、 保存
54 set\-user\-ID を設定する。
55
56 非特権ユーザーのプロセスは、その実 UID、実効 UID、保存 set\-user\-ID を、 現在の実 UID、現在の実効 UID、現在の保存
57 set\-user\-ID のどれかに変更することができる:
58
59 特権プロセス (Linux では \fBCAP_SETUID\fP ケーパビリティ (capability) を持つ プロセス) は、実 UID、実効
60 UID、保存 set\-user\-ID を任意の値に設定できる。
61
62 引き数のどれかが \-1 の場合はその値は変更されずに残される。
63
64 Regardless of what changes are made to the real UID, effective UID, and
65 saved set\-user\-ID, the filesystem UID is always set to the same value as the
66 (possibly new) effective UID.
67
68 Completely analogously, \fBsetresgid\fP()  sets the real GID, effective GID,
69 and saved set\-group\-ID of the calling process (and always modifies the
70 filesystem GID to be the same as the effective GID), with the same
71 restrictions for unprivileged processes.
72 .SH 返り値
73 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
74 .SH エラー
75 .TP 
76 \fBEAGAIN\fP
77 \fIuid\fP が現在のユーザー ID と違う値で、 この呼び出しにより ユーザー ID が リソース上限 \fBRLIMIT_NPROC\fP
78 を超えてしまう。
79 .TP 
80 \fBEPERM\fP
81 呼び出したプロセスが特権を持たないのに (\fBCAP_SETUID\fP ケーパビリティを持たないのに)、 ID を許されていない値に変更しようとした。
82 .SH バージョン
83 Linux ではバージョン 2.1.44 より利用可能になった。
84 .SH 準拠
85 これらのコールは非標準である。 HP\-UX や BSD 系のいくつかにも存在する。
86 .SH 注意
87 HP\-UX や FreeBSD では \fI<unistd.h>\fP にプロトタイプが存在する。
88 Linux では、glibc 2.3.2 以降で プロトタイプが提供されている。
89
90 元々の Linux の \fBsetresuid\fP() と \fBsetresgid\fP() システムコールは
91 16 ビットのグループ ID だけに対応していた。
92 その後、Linux 2.4 で、32 ビットの ID に対応した
93 \fBsetresuid32\fP() と \fBsetresgid32\fP() が追加された。
94 glibc の \fBsetresuid\fP() と \fBsetresgid\fP() のラッパー関数は
95 カーネルバージョンによるこの違いを吸収している。
96 .SH 関連項目
97 \fBgetresuid\fP(2), \fBgetuid\fP(2), \fBsetfsgid\fP(2), \fBsetfsuid\fP(2),
98 \fBsetreuid\fP(2), \fBsetuid\fP(2), \fBcapabilities\fP(7), \fBcredentials\fP(7)
99 .SH この文書について
100 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
101 である。プロジェクトの説明とバグ報告に関する情報は
102 http://www.kernel.org/doc/man\-pages/ に書かれている。