OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / chroot.2
index d87bedc..f2d12eb 100644 (file)
@@ -1,7 +1,6 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
 .\"
+.\" %%%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.
@@ -21,6 +20,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Modified by Michael Haardt <michael@moria.de>
 .\" Modified 1993-07-21 by Rik Faith <faith@cs.unc.edu>
 .\" Modified 1997-08-21 by Joseph S. Myers <jsm28@cam.ac.uk>
 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
 .\" Japanese Version Copyright (c) 1996 Yosiaki Yanagihara
 .\"         all rights reserved.
 .\" Translated Mon Jun 24 14:29:55 JST 1996
 .\" Updated & Modified Thu Dec 23 10:04:20 JST 2004
 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
 .\"
-.TH CHROOT 2 2010-09-20 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.\"O chroot \- change root directory
-.SH Ì¾Á°
-chroot \- ¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
-.B #include <unistd.h>
+.TH CHROOT 2 2010\-09\-20 Linux "Linux Programmer's Manual"
+.SH 名前
+chroot \- ルート・ディレクトリを変更する
+.SH 書式
+\fB#include <unistd.h>\fP
 .sp
-.BI "int chroot(const char *" path );
+\fBint chroot(const char *\fP\fIpath\fP\fB);\fP
 .sp
 .in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
-.RB ( feature_test_macros (7)
-»²¾È):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .in
 .sp
-.BR chroot ():
+\fBchroot\fP():
 .ad l
 .RS 4
 .PD 0
-.TP 4
-.\"O Since glibc 2.2.2:
-glibc 2.2.2 °Ê¹ß:
+.TP  4
+glibc 2.2.2 以降:
 .nf
 _BSD_SOURCE ||
     (_XOPEN_SOURCE\ >=\ 500 ||
         _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) &&
     !(_POSIX_C_SOURCE\ >=\ 200112L || _XOPEN_SOURCE\ >=\ 600)
+.TP  4
 .fi
-.TP 4
-.\"O Before glibc 2.2.2: none
-glibc 2.2.2 ¤è¤êÁ°: ¤Ê¤·
+glibc 2.2.2 より前: なし
 .PD
 .RE
 .ad b
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O .BR chroot ()
-.\"O changes the root directory of the calling process to that specified in
-.\"O .IR path .
-.\"O This directory will be used for pathnames beginning with \fI/\fP.
-.\"O The root directory is inherited by all children of the calling process.
-.BR chroot ()
-¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò
-.I path
-¤Ç»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¡£
-¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤¬ \fI/\fP ¤«¤é»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤È¤·¤Æ»È¤ï¤ì¤ë¡£
-¤³¤Î¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ÎÁ´¤Æ¤Î»Ò¥×¥í¥»¥¹¤Ë¼õ¤±·Ñ¤¬¤ì¤ë¡£
-.\"O 
-.PP
-.\"O Only a privileged process (Linux: one with the
-.\"O .B CAP_SYS_CHROOT
-.\"O capability) may call
-.\"O .BR chroot ().
-Æø¢¥×¥í¥»¥¹ (Linux ¤Ç¤Ï¡¢
-.B CAP_SYS_CHROOT
-¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹) ¤Î¤ß¤¬
-.BR chroot ()
-¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¡£
-.\"O 
-.PP
-.\"O This call changes an ingredient in the pathname resolution process
-.\"O and does nothing else.
-¤³¤Î¥³¡¼¥ë¤Ï¥Ñ¥¹Ì¾²ò·è¤Î²áÄø¤Ç¹½À®Í×ÁǤòÊѹ¹¤¹¤ë¤Î¤ß¤Ç¡¢
-¤½¤Î¾¤Ë¤Ï²¿¤â¹Ô¤ï¤Ê¤¤¡£
-.\"O 
-.PP
-.\"O This call does not change the current working directory,
-.\"O so that after the call \(aq\fI.\fP\(aq can
-.\"O be outside the tree rooted at \(aq\fI/\fP\(aq.
-.\"O In particular, the superuser can escape from a "chroot jail"
-.\"O by doing:
-¤³¤Î¥³¡¼¥ë¤Ï¸½ºß¤Îºî¶È¥Ç¥£¥ì¥¯¥È¥ê
-(working directory) ¤òÊѹ¹¤·¤Ê¤¤¡£
-¤½¤Î¤¿¤á¡¢¤³¤Î¥³¡¼¥ë¤Î¸å¤Ë \(aq\fI.\fP\(aq ¤¬ \(aq\fI/\fP\(aq ¤ò
-º¬¤È¤¹¤ë¥Ä¥ê¡¼¤Î³°¤Ë¤Ê¤ë¾ì¹ç¤¬¤¢¤ë¡£
-Æäˡ¢¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¤³¤È¤Ç
-"chroot jail" ¤«¤éƨ¤²½Ð¤»¤Æ¤·¤Þ¤¦¡£
+.SH 説明
+\fBchroot\fP()  は、呼び出し元プロセスのルート・ディレクトリを \fIpath\fP で指定されたディレクトリに変更する。 このディレクトリ以下が
+\fI/\fP から始まるパス名として使われる。 このルート・ディレクトリは呼び出し元のプロセスの全ての子プロセスに受け継がれる。
+
+特権プロセス (Linux では、 \fBCAP_SYS_CHROOT\fP ケーパビリティを持つプロセス) のみが \fBchroot\fP()
+を呼び出すことができる。
+
+このコールはパス名解決の過程で構成要素を変更するのみで、 その他には何も行わない。
+
+このコールは現在の作業ディレクトリ (working directory) を変更しない。 そのため、このコールの後に \(aq\fI.\fP\(aq が
+\(aq\fI/\fP\(aq を 根とするツリーの外になる場合がある。 特に、スーパー・ユーザーは以下のようにすることで "chroot jail"
+から逃げ出せてしまう。
 .nf
 
     mkdir foo; chroot foo; cd ..
 .fi
 
-.\"O This call does not close open file descriptors, and such file
-.\"O descriptors may allow access to files outside the chroot tree.
-¤³¤Î¥³¡¼¥ë¤Ï¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¤Î¤Ç¡¢
-¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï chroot ¥Ä¥ê¡¼¤Î³°¤Ë¤¢¤ë
-¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£
-.\"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 ¥¨¥é¡¼
-.\"O Depending on the file system, other errors can be returned.
-.\"O The more general errors are listed below:
-¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¾¤Î¥¨¥é¡¼¤¬ÊÖ¤µ¤ì¤ë»ö¤¬¤¢¤ë¡£
-°ìÈÌŪ¤Ê¥¨¥é¡¼¤ò°Ê²¼¤Ëµó¤²¤ë:
-.TP
-.B EACCES
-.\"O Search permission is denied on a component of the path prefix.
-¥Ñ¥¹Ì¾¤ÎÅÓÃæ¤Î¤É¤³¤«¤Ë¸¡º÷µö²Ä (search permission) ¤¬¤Ê¤¤¡£
-.\"O (See also
-.\"O .BR path_resolution (7).)
-.RB ( path_resolution (7)
-¤â»²¾È¤¹¤ë¤³¤È¡£)
-.\"O .\" Also search permission is required on the final component,
-.\"O .\" maybe just to guarantee that it is a directory?
-.\" ¥Ñ¥¹Ì¾¤ÎºÇ¸å¤Î¹½À®Í×ÁǤˤ⸡º÷µö²Ä¤¬É¬ÍפǤ¢¤ë¡£
-.\" ¤ª¤½¤é¤¯¡¢¤½¤ì¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤³¤È¤òÊݾڤ¹¤ë¤¿¤á¤Ê¤Î¤«?
-.TP
-.B EFAULT
-.\"O .I path
-.\"O points outside your accessible address space.
-.I path
-¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£
-.TP
-.B EIO
-.\"O An I/O error occurred.
-I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-.TP
-.B ELOOP
-.\"O Too many symbolic links were encountered in resolving
-.\"O .IR path .
-.I path
-¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£
-.TP
-.B ENAMETOOLONG
-.\"O .I path
-.\"O is too long.
-.I path
-¤¬Ä¹²á¤®¤ë¡£
-.TP
-.B ENOENT
-.\"O The file does not exist.
-¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£
-.TP
-.B ENOMEM
-.\"O Insufficient kernel memory was available.
-¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£
-.TP
-.B ENOTDIR
-.\"O A component of
-.\"O .I path
-.\"O is not a directory.
-.I path
-¤ÎÆâÍƤ¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¤¡£
-.TP
-.B EPERM
-.\"O The caller has insufficient privilege.
-¸Æ¤Ó½Ð¤·Â¦¤Ë½½Ê¬¤ÊÆø¢¤¬¤Ê¤¤¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O SVr4, 4.4BSD, SUSv2 (marked LEGACY).
-.\"O This function is not part of POSIX.1-2001.
-.\"O .\" SVr4 documents additional EINTR, ENOLINK and EMULTIHOP error conditions.
-.\"O .\" X/OPEN does not document EIO, ENOMEM or EFAULT error conditions.
-SVr4, 4.4BSD, SUSv2 (⤷¡¢SUSv2 ¤Ç¤Ï²áµî¤Î̾»Ä¤È¤µ¤ì¤Æ¤¤¤ë)¡£
-¤³¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£
-.\" SVr4 ¤Ë¤Ï¾¤Ë EINTR, ENOLINK, EMULTIHOP ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£
-.\" X/OPEN ¤Ë¤Ï EIO, ENOMEM, EFAULT ¥¨¥é¡¼¾õÂ֤ε­½Ò¤Ï¤Ê¤¤¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O A child process created via
-.\"O .BR fork (2)
-.\"O inherits its parent's root directory.
-.\"O The root directory is left unchanged by
-.\"O .BR execve (2).
-.BR fork (2)
-¤ÇºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ï¡¢
-¿Æ¥×¥í¥»¥¹¤Î¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò·Ñ¾µ¤¹¤ë¡£
-.BR execve (2)
-¤Î¾ì¹ç¤â¡¢¥ë¡¼¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ÏÊѹ¹¤µ¤ì¤Ê¤¤¡£
+このコールはオープンファイルディスクリプタをクローズしないので、 このようなファイルディスクリプタは chroot ツリーの外にある
+ファイルにアクセスできる。
+.SH 返り値
+成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
+.SH エラー
+ファイルシステムによっては他のエラーが返される事がある。 一般的なエラーを以下に挙げる:
+.TP 
+\fBEACCES\fP
+.\" Also search permission is required on the final component,
+.\" maybe just to guarantee that it is a directory?
+パス名の構成要素に検索許可がない (\fBpath_resolution\fP(7)  も見よ)。
+.TP 
+\fBEFAULT\fP
+\fIpath\fP がアクセスできるアドレス空間外を指している。
+.TP 
+\fBEIO\fP
+I/O エラーが発生した。
+.TP 
+\fBELOOP\fP
+\fIpath\fP を解決する際に遭遇したシンボリック・リンクが多過ぎる。
+.TP 
+\fBENAMETOOLONG\fP
+\fIpath\fP が長過ぎる。
+.TP 
+\fBENOENT\fP
+ファイルが存在しない。
+.TP 
+\fBENOMEM\fP
+カーネルに十分なメモリがない。
+.TP 
+\fBENOTDIR\fP
+\fIpath\fP の構成要素がディレクトリではない。
+.TP 
+\fBEPERM\fP
+呼び出し側に十分な特権がない。
+.SH 準拠
+.\" SVr4 documents additional EINTR, ENOLINK and EMULTIHOP error conditions.
+.\" X/OPEN does not document EIO, ENOMEM or EFAULT error conditions.
+SVr4, 4.4BSD, SUSv2 (但し、SUSv2 では過去の名残とされている)。 この関数は POSIX.1\-2001 にはない。
+.SH 注意
+\fBfork\fP(2)  で作成された子プロセスは、 親プロセスのルート・ディレクトリを継承する。 \fBexecve\fP(2)
+の場合も、ルート・ディレクトリは変更されない。
 
-.\"O FreeBSD has a stronger
-.\"O .BR jail ()
-.\"O system call.
-FreeBSD ¤Ë¤Ï¤è¤ê¶¯ÎϤÊ
-.BR jail ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¢¤ë¡£
 .\" FIXME . eventually say something about containers,
 .\" virtual servers, etc.?
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR chdir (2),
-.BR path_resolution (7)
+FreeBSD にはより強力な \fBjail\fP()  システムコールがある。
+.SH 関連項目
+\fBchdir\fP(2), \fBpath_resolution\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。