February 2012
Intermediate to advanced
1184 pages
37h 17m
English
chroot FILENAME
chrootIf successful, FILENAME becomes
the new root directory for the current process—the starting point for
pathnames beginning with “/”. This
directory is inherited across exec
calls and by all subprocesses forked
after the chroot call. There is no
way to undo a chroot. For security
reasons, only the superuser can use this function. Here’s some code that
approximates what many FTP servers do:
chroot((getpwnam("ftp"))[7])
|| die "can't do anonymous ftp: $!";This function is unlikely to work on non-Unix systems. See chroot(2).
Read now
Unlock full access