This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlfunc: Should chdir("/") immed after chroot
[perl5.git] / pod / perlfunc.pod
index 0cc1e9a..d762600 100644 (file)
@@ -1012,6 +1012,9 @@ change your current working directory, which is unaffected.)  For security
 reasons, this call is restricted to the superuser.  If FILENAME is
 omitted, does a C<chroot> to C<$_>.
 
+B<NOTE:>  It is good security practice to do C<chdir("/")> (to the root
+directory) immediately after a C<chroot()>.
+
 Portability issues: L<perlport/chroot>.
 
 =item close FILEHANDLE