OSDN Git Service

Retire LDP man-pages repository
[linuxjm/LDP_man-pages.git] / draft / man2 / setuid.2
diff --git a/draft/man2/setuid.2 b/draft/man2/setuid.2
deleted file mode 100644 (file)
index 55ab708..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-.\" Copyright (C), 1994, Graeme W. Wilford (Wilf).
-.\"
-.\" %%%LICENSE_START(VERBATIM)
-.\" 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.
-.\" %%%LICENSE_END
-.\"
-.\" Fri Jul 29th 12:56:44 BST 1994  Wilf. <G.Wilford@ee.surrey.ac.uk>
-.\" Changes inspired by patch from Richard Kettlewell
-.\"   <richard@greenend.org.uk>, aeb 970616.
-.\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
-.\"     Added notes on capability requirements
-.\"*******************************************************************
-.\"
-.\" This file was generated with po4a. Translate the source file.
-.\"
-.\"*******************************************************************
-.\"
-.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
-.\"         all rights reserved.
-.\" Translated Sat Mar  1 16:32:11 JST 1997
-.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
-.\" Modified Sun Sep 28 20:26:49 JST 1997
-.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
-.\" Updated & Modified Sat May 22 18:21:45 JST 2004
-.\"         by Yuichi SATO <ysato444@yahoo.co.jp>
-.\" Updated & Modified Wed Jan  5 00:51:28 JST 2005 by Yuichi SATO
-.\" Updated 2010-04-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.24
-.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
-.\"
-.TH SETUID 2 2014\-09\-21 Linux "Linux Programmer's Manual"
-.SH 名前
-setuid \- ユーザー識別 (identity) を設定する
-.SH 書式
-\fB#include <sys/types.h>\fP
-.br
-\fB#include <unistd.h>\fP
-.sp
-\fBint setuid(uid_t \fP\fIuid\fP\fB);\fP
-.SH 説明
-\fBsetuid\fP()  は呼び出し元のプロセスの実効 (effective) ユーザー ID を設定する。 もし呼び出し元プロセスの実効 UID が
-root ならば、 実 (real) UID と保存 (saved) set\-user\-ID も設定される。
-.PP
-Linux では、 \fBsetuid\fP()  は \fB_POSIX_SAVED_IDS\fP をもった POSIX 版のように実装されている。 これは
-(ルート以外の) set\-user\-ID プログラムにそのユーザーの特権を 全て与え、特権の必要ない仕事をし、本来の実効ユーザー ID に
-安全な方法で再び戻すことを許す。
-.PP
-ユーザーが root またはプログラムが root に set\-user\-ID されているならば、 特別の注意が払われる。 \fBsetuid\fP()
-関数は呼び出し者の実効ユーザー ID をチェックし、 それがスーパーユーザーならば、 プロセスに関連する全てのユーザー ID に \fIuid\fP
-を設定する。 これが行なわれた後にはプログラムが再びルートの特権を得ることはできない。
-.PP
-したがって、set\-user\-ID\-root プログラムで、一時的にルート特権を解除し、
-非特権ユーザーであるかのように振舞い、後でルート権限をもう一度得ようと する場合には、 \fBsetuid\fP()  を使うことができない。その場合には、
-\fBseteuid\fP(2)  を使う必要がある。
-.SH 返り値
-成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
-
-\fI注意\fP: 呼び出し元が UID 0 であっても \fBsetuid\fP() が失敗する場合がある。 \fBsetuid\fP()
-からのリターンが失敗かどうかの確認を省略することは重大なセキュリティ上のエラーとなる。
-.SH エラー
-.TP 
-\fBEAGAIN\fP
-この呼び出しで呼び出し元の実 UID が変更されるはずだったが (つまり、 \fIuid\fP が呼び出し元の実 UID と一致していない)、
-必要なカーネルのデータ構造体の割り当てで一時的な失敗があった。
-.TP 
-\fBEAGAIN\fP
-\fIuid\fP は呼び出し元の実 UID と一致しておらず、 この呼び出しで実ユーザー ID \fIruid\fP に属するプロセス数が呼び出し元の
-\fBRLIMIT_NPROC\fP リソース上限を超過するところであった。 Linux 3.1 以降では、このエラーはもはや発生することはない
-(しかし、堅牢性が求められるアプリケーションではこのエラーを確認すべきである)。 \fBexecve\fP(2) の \fBEAGAIN\fP の説明を参照。
-.TP 
-\fBEINVAL\fP
-\fIuid\fP で指定されたユーザー ID がこのユーザー名前空間では有効ではない。
-.TP 
-\fBEPERM\fP
-ユーザーが特権を持たず (Linux では \fBCAP_SETUID\fP ケーパビリティ (capability) を持たず)、 \fIuid\fP
-が呼び出し元プロセスの実 UID または保存 set\-user\-ID と一致しない。
-.SH 準拠
-.\" SVr4 documents an additional EINVAL error condition.
-SVr4, POSIX.1\-2001.  4.4BSD のコールとは完全な互換性はない、 BSD のコールは実 (real)、保存 (saved)、実効
-(effective) ID の全てを設定する。
-.SH 注意
-Linux はファイルシステムユーザー ID の概念を持つ。
-通常、これは実効ユーザー ID に等しい。
-\fBsetuid\fP()  コールは呼び出し元のプロセスの
-ファイルシステムユーザー ID も設定する。
-\fBsetfsuid\fP(2) も参照すること。
-.PP
-\fIuid\fP が前の実効 UID と異っていた場合、
-プロセスはコアダンプすることを禁止される。
-
-元々の Linux の \fBsetuid\fP() システムコールは
-16 ビットのグループ ID だけに対応していた。
-その後、Linux 2.4 で、32 ビットの ID に対応した
-\fBsetuid32\fP() が追加された。
-glibc の \fBsetuid\fP() のラッパー関数は
-カーネルバージョンによるこの違いを吸収している。
-.SH 関連項目
-\fBgetuid\fP(2), \fBseteuid\fP(2), \fBsetfsuid\fP(2), \fBsetreuid\fP(2),
-\fBcapabilities\fP(7), \fBcredentials\fP(7), \fBuser_namespaces\fP(7)
-.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
-である。プロジェクトの説明とバグ報告に関する情報は
-http://www.kernel.org/doc/man\-pages/ に書かれている。