Differences between current version and revision by previous author of chroot(2).
Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History
Newer page: | version 2 | Last edited on Wednesday, October 30, 2002 12:07:08 am | by PerryLorier | |
Older page: | version 1 | Last edited on Tuesday, June 4, 2002 12:23:39 am | by perry | Revert |
@@ -1,119 +1,45 @@
CHROOT
!!!CHROOT
-NAME
-SYNOPSIS
-DESCRIPTION
-RETURN VALUE
-ERRORS
-CONFORMING
TO
+
TO
SEE ALSO
----
!!NAME
-
chroot - change root directory
!!SYNOPSIS
+ __#include <unistd.h>__
-__#include __
-
-
__int chroot(const char
-
*__''path''__);__
+
__int chroot(const char *__''path''__);__
!!DESCRIPTION
+__chroot__ changes the root directory to that specified in ''path''. This directory will be used for path names beginning with /. The root directory is inherited by all children of the current process.
-__chroot__ changes
the root directory to that specified
-in ''path''. This directory will be used for path names
-beginning with /. The root directory is inherited by all
-children of the current process
.
+Only the super-user may change
the root directory.
+Note that this call does not change the current working directory, so that `.' can be outside the tree rooted at `/'. In particular, the super-user can escape from a `chroot jail' by doing `mkdir foo; chroot foo; cd ..'.
-Only the super-user may change the root
-directory.
-
-
-Note that this call does not change the current working
-directory, so that `.' can be outside the tree rooted at
-`/'. In particular, the super-user can escape from a `chroot
-jail' by doing `mkdir foo; chroot foo; cd ..'.
!!RETURN VALUE
-
-
On success, zero is returned. On error, -1 is returned, and
-
''errno'' is set appropriately.
+On success, zero is returned. On error, -1 is returned, and ''errno'' is set appropriately.
!!ERRORS
+Depending on the file system, other errors can be returned. The more general errors are listed below:
-Depending
on the file system, other errors can be returned
.
-The more general errors are listed below
:
+;[EPERM]: The effective UID is not zero.
+;[EFAULT]: ''path'' points outside your accessible address space.
+;[ENAMETOOLONG]: ''path'' is too long.
+;[ENOENT]: The file does not exist.
+;[ENOMEM]: Insufficient kernel memory was available.
+;[ENOTDIR]: A component of ''path'' is not a directory.
+;[EACCES]: Search permission is denied
on a component of
the path prefix
.
+;[ELOOP]
: Too many symbolic links were encountered in resolving ''path''.
+;[EIO]: An I/O error occurred.
-
-__EPERM__
-
-
-The effective UID is not zero.
-
-
-__EFAULT__
-
-
-''path'' points outside your accessible address
-space.
-
-
-__ENAMETOOLONG__
-
-
-''path'' is too long.
-
-
-__ENOENT__
-
-
-The file does not exist.
-
-
-__ENOMEM__
-
-
-Insufficient kernel memory was available.
-
-
-__ENOTDIR__
-
-
-A component of ''path'' is not a directory.
-
-
-__EACCES__
-
-
-Search permission is denied on a component of the path
-prefix.
-
-
-__ELOOP__
-
-
-Too many symbolic links were encountered in resolving
-''path''.
-
-
-__EIO__
-
-
-An I/O error occurred.
!!CONFORMING TO
-
-
SVr4, SVID, 4.4BSD, X/OPEN. This function is not part of
-
POSIX.1. SVr4 documents additional EINTR, ENOLINK and
-
EMULTIHOP error conditions. X/OPEN does not document EIO,
-
ENOMEM or EFAULT error conditions. This interface is marked
-
as legacy by X/OPEN.
+SVr4, SVID, 4.4BSD, X/OPEN. This function is not part of POSIX.1. SVr4 documents additional [
EINTR]
, [
ENOLINK]
and [
EMULTIHOP]
error conditions. X/OPEN does not document [
EIO]
, [
ENOMEM]
or [
EFAULT]
error conditions. This interface is marked as legacy by X/OPEN.
!!SEE ALSO
-
chdir(2)
-----