summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/chroot.2
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-09-24 02:38:30 +0000
committerderaadt <deraadt@openbsd.org>1996-09-24 02:38:30 +0000
commit060a3d582d1fb471cf698664b4e9d6fb44dbbc91 (patch)
tree1546e8f56df4cc9b8b7425b2e3bf2b77d57846f6 /lib/libc/sys/chroot.2
parentMinor warning about unterminated constant fixed (diff)
downloadwireguard-openbsd-060a3d582d1fb471cf698664b4e9d6fb44dbbc91.tar.xz
wireguard-openbsd-060a3d582d1fb471cf698664b4e9d6fb44dbbc91.zip
unescapeable chroot; thanks to nirva and asriel for helping
Diffstat (limited to 'lib/libc/sys/chroot.2')
-rw-r--r--lib/libc/sys/chroot.28
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libc/sys/chroot.2 b/lib/libc/sys/chroot.2
index 74c64ee4b49..0b66b680706 100644
--- a/lib/libc/sys/chroot.2
+++ b/lib/libc/sys/chroot.2
@@ -57,10 +57,16 @@ beginning with
In order for a directory to become the root directory
a process must have execute (search) access for that directory.
.Pp
-It should be noted that
+If the program is not currently running with an altered root directory,
+it should be noted that
.Fn chroot
has no effect on the process's current directory.
.Pp
+If the program is already running with an altered root directory, the
+process's current directory is changed to the same new root directory.
+This prevents the current directory from being further up the directory
+tree than the altered root directory.
+.Pp
This call is restricted to the super-user.
.Sh RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise,