perl-5.38.0
chroot FILENAME
chroot

This function works like the system call by the same name: it makes the named directory the new root directory for all further pathnames that begin with a / by your process and all its children. (It doesn't change your current working directory, which is unaffected.) For security reasons, this call is restricted to the superuser. If FILENAME is omitted, does a chroot to $_.

同じ名前のシステムコールと同じことをします: 現在のプロセス及び子プロセスに 対して、/で始まるパス名に関して指定されたディレクトリを新しい ルートディレクトリとして扱います。 (これはカレントディレクトリを変更しません; カレントディレクトリは そのままです。) セキュリティ上の理由により、この呼び出しはスーパーユーザーしか行えません。 FILENAME を省略すると、$_chroot します。

NOTE: It is mandatory for security to chdir("/") (chdir to the root directory) immediately after a chroot, otherwise the current working directory may be outside of the new root.

注意: chroot の直後に (ルートディレクトリに chdir する) chdir("/") するのはセキュリティ上必須です; さもなければ現在の作業ディレクトリは新しいルートの外側かもしれません。

Portability issues: "chroot" in perlport.

移植性の問題: "chroot" in perlport