.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (C) 1997 Andries Brouwer (aeb@cwi.nl) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Modified, 2003-05-26, Michael Kerrisk, .\" .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya .\" all rights reserved. .\" Translated 1997-08-30, HANATAKA Shinya .\" Updated & Modified 2004-05-22, Yuichi SATO .\" Updated & Modified 2005-01-04, Yuichi SATO .\" Updated & Modified 2005-09-03, Akihiro MOTOKI .\" Updated & Modified 2005-11-04, Akihiro MOTOKI .\" .\"WORD: effective user ID 実効ユーザーID .\"WORD: real user ID 実ユーザーID .\"WORD: saved set-user-ID 保存セットユーザーID .\"WORD: effective group ID 実効グループID .\"WORD: real group ID 実グループID .\"WORD: saved group ID 保存グループID .\" .TH SETRESUID 2 2007-07-26 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O setresuid, setresgid \- set real, effective and saved user or group ID setresuid, setresgid \- ユーザやグループの 実、実効、保存 ID を設定する .\"O .SH SYNOPSIS .SH 書式 .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" .br .B #include .sp .BI "int setresuid(uid_t " ruid ", uid_t " euid ", uid_t " suid ); .br .BI "int setresgid(gid_t " rgid ", gid_t " egid ", gid_t " sgid ); .\"O .SH DESCRIPTION .SH 説明 .\"O .BR setresuid () .\"O sets the real user ID, the effective user ID, and the .\"O saved set-user-ID of the calling process. .BR setresuid () は呼び出し元のプロセスの実 (real) ユーザーID、実効 (effective) ユーザーID、 保存 set-user-ID を設定する。 .\"O Unprivileged user processes .\"O may change the real UID, .\"O effective UID and saved set-user-ID, each to one of: .\"O the current real UID, the current effective UID or the .\"O current saved set-user-ID. 非特権ユーザーのプロセスは、その実 UID、実効 UID、保存 set-user-ID を、 現在の実 UID、現在の実効 UID、現在の保存 set-user-ID のどれかに変更することができる: .\"O Privileged processes (on Linux, those having the \fBCAP_SETUID\fP capability) .\"O may set the real UID, effective UID, and .\"O saved set-user-ID to arbitrary values. 特権プロセス (Linux では \fBCAP_SETUID\fP ケーパビリティ (capability) を持つ プロセス) は、実 UID、実効 UID、保存 set-user-ID を任意の値に設定できる。 .\"O If one of the arguments equals \-1, the corresponding value is not changed. 引き数のどれかが \-1 の場合はその値は変更されずに残される。 .\"O Regardless of what changes are made to the real UID, effective UID, .\"O and saved set-user-ID, the file system UID is always set to the same .\"O value as the (possibly new) effective UID. 実 UID、実効 UID、保存 set-user-ID にどんな変更が行われたかに関わらず、 ファイルシステム UID は常に実効 UID (可能であれば変更後の新しい実効 UID) と同じ値に設定される。 .\"O Completely analogously, .\"O .BR setresgid () .\"O sets the real GID, effective GID, and saved set-group-ID .\"O of the calling process (and always modifies the file system GID .\"O to be the same as the effective GID), .\"O with the same restrictions for unprivileged processes. 全く同じように、 .BR setresgid () は呼び出し元のプロセスの実 GID、実効 GID、保存 set-group-ID を設定する (さらにファイルシステム GID を実効 GID と同じ値に修正する)。 非特権プロセスは同様の制限を受ける。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, zero is returned. .\"O On error, \-1 is returned, and .\"O .I errno .\"O is set appropriately. 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 .I errno が適切に設定される。 .\"O .SH ERRORS .SH エラー .TP .B EAGAIN .\"O .I uid .\"O does not match the current UID and this call would .\"O bring that user ID over its .\"O .B RLIMIT_NPROC .\"O resource limit. .I uid が現在のユーザー ID と違う値で、 この呼び出しにより ユーザー ID が リソース上限 .B RLIMIT_NPROC を超えてしまう。 .TP .B EPERM .\"O The calling process is not privileged (did not have the \fBCAP_SETUID\fP .\"O capability) and tried to change the IDs to values that are not permitted. 呼び出したプロセスが特権を持たないのに (\fBCAP_SETUID\fP ケーパビリティを持たないのに)、 ID を許されていない値に変更しようとした。 .\"O .SH VERSIONS .SH バージョン .\"O It is available under Linux since Linux 2.1.44. Linux ではバージョン 2.1.44 より利用可能になった。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O These calls are nonstandard; .\"O they also appear on HP-UX and some of the BSDs. これらのコールは非標準である。 HP-UX や BSD 系のいくつかにも存在する。 .\"O .SH NOTES .SH 注意 .\"O Under HP-UX and FreeBSD the prototype is found in .\"O .IR . HP-UX や FreeBSD では .I にプロトタイプが存在する。 .\"O Under Linux the prototype is provided by glibc since version 2.3.2. Linux では、glibc 2.3.2 以降で プロトタイプが提供されている。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR getresuid (2), .BR getuid (2), .BR setfsgid (2), .BR setfsuid (2), .BR setreuid (2), .BR setuid (2), .BR capabilities (7), .BR credentials (7)