aboutsummaryrefslogtreecommitdiff
path: root/documentation/manual-pages/ja/man2/setreuid.2
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/manual-pages/ja/man2/setreuid.2')
-rw-r--r--documentation/manual-pages/ja/man2/setreuid.291
1 files changed, 91 insertions, 0 deletions
diff --git a/documentation/manual-pages/ja/man2/setreuid.2 b/documentation/manual-pages/ja/man2/setreuid.2
new file mode 100644
index 0000000000..b29d7439a2
--- /dev/null
+++ b/documentation/manual-pages/ja/man2/setreuid.2
@@ -0,0 +1,91 @@
+.\" Copyright (c) 1980, 1991, 1993, 1994
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)setreuid.2 8.2 (Berkeley) 4/16/94
+.\" %FreeBSD: src/lib/libc/sys/setreuid.2,v 1.16 2002/12/18 09:22:31 ru Exp %
+.\"
+.\" $FreeBSD$
+.Dd February 8, 2001
+.Dt SETREUID 2
+.Os
+.Sh 名称
+.Nm setreuid
+.Nd 実ユーザ ID と実効ユーザ ID を設定する
+.Sh ライブラリ
+.Lb libc
+.Sh 書式
+.In unistd.h
+.Ft int
+.Fn setreuid "uid_t ruid" "uid_t euid"
+.Sh 解説
+現在のプロセスの実ユーザ ID と実効ユーザ ID が引数に従って設定されます。
+.Fa ruid
+または
+.Fa euid
+が -1 の場合、現在の UID が指定されたことになります。
+特権のないユーザは、実ユーザ ID をその実効ユーザ ID に、
+または実効ユーザ ID をその実ユーザ ID に変更できます。
+スーパユーザだけがその他の変更を行えます。
+.Pp
+実ユーザ ID が変更された場合 (つまり
+.Fa ruid
+が -1 ではない)、
+もしくは実効ユーザ ID がその実ユーザ ID 以外へと変更された場合、
+退避ユーザ ID はその実効ユーザ ID へ設定されます。
+.Pp
+.Fn setreuid
+システムコールはユーザ ID 設定プログラム内で実ユーザ ID と実効ユーザ ID を
+スワップし、ユーザ ID 設定の値を一時的に放棄するために使われてきました。
+この目的は、現在では
+.Xr seteuid 2
+システムコールを使用するとより良く達成できます。
+.Pp
+実ユーザ ID と実効ユーザ ID を同じ値に設定するときは、標準の
+.Fn setuid
+システムコールを使用するようにしてください。
+.Sh 戻り値
+.Rv -std setreuid
+.Sh エラー
+.Bl -tag -width Er
+.It Bq Er EPERM
+現在のプロセスがスーパユーザでなく、実効ユーザ ID を実ユーザ ID に
+変更する以外の変更が指定されました。
+.El
+.Sh 関連項目
+.Xr getuid 2 ,
+.Xr issetugid 2 ,
+.Xr seteuid 2 ,
+.Xr setuid 2
+.Sh 歴史
+.Fn setreuid
+システムコールは
+.Bx 4.2
+で登場しました。