|
|
1.1 root 1: .TH CHDIR 2
2: .CT 2 dirs
3: .SH NAME
4: chdir, chroot \(mi change working or root directory
5: .SH SYNOPSIS
6: .nf
7: .B int chdir(dirname)
8: .B char *dirname;
9: .PP
10: .B int chroot(dirname)
11: .B char *dirname;
12: .fi
13: .SH DESCRIPTION
14: .I Chdir
15: changes the working directory
16: of the invoking process to
17: .IR dirname ;
18: .I chroot
19: changes its root directory.
20: .PP
21: The root directory
22: is the starting point
23: when searching
24: for pathnames
25: beginning with
26: .LR / .
27: The working directory is the starting point
28: for pathnames that don't.
29: The root directory normally points to the system root.
30: .IR Login (8)
31: initially sets the working directory
32: as specified in the password file.
33: .PP
34: After
35: .IR chroot ,
36: it is impossible to name a file
37: outside the subtree rooted at the current root, provided
38: that the current directory is located within the subtree
39: and there are no links pointing outside the subtree
40: (except for the entry
41: .L \&..
42: in the root directory).
43: .PP
44: .I Chroot
45: may only be used by the super-user.
46: .SH SEE ALSO
47: .IR sh (1),
48: .IR passwd (5)
49: .SH DIAGNOSTICS
50: .BR EACCES ,
51: .BR EFAULT ,
52: .BR EIO ,
53: .BR ELOOP ,
54: .BR ENOENT ,
55: .BR ENOTDIR ,
56: .BR EPERM
57: .RI ( chroot
58: only)
59: .SH BUGS
60: Using
61: .IR chroot ,
62: it is quite easy to fool set-userid programs about
63: the contents of the password file (for example).
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.