Version 1.2.0.
[checkpath] / chkpath.1
... / ...
CommitLineData
1.\" -*-nroff-*-
2.TH chkpath 1 "6 April 1999" "Local tools"
3.SH NAME
4chkpath \- check a path string for security
5.SH SYNOPSIS
6.B chkpath
7.RB [ \-vqstp ]
8.RI [ path ...]
9.SH USAGE
10The
11.B chkpath
12command checks one or more path strings (i.e., lists of directories
13separated by colons) for security. If no path strings are given, the
14value of the
15.B PATH
16environment variable is examined.
17.PP
18Each directory in turn is broken into its constituent parts and every
19step which must be made through the filesystem to reach that directory
20from the root is scrutinized for vulnerabilities. The checks made
21against each directory and symbolic link along the way are as follows:
22.IP " 1."
23No step should be a directory which is world-writable unless its sticky
24bit is set, and it's not the final step.
25.IP " 2."
26No step should be a directory which is group-writable unless its sticky
27bit is set, and it's not the final step. (However, see the
28.B \-t
29option below.)
30.IP " 3."
31No step should be a directory owned by another user (other than root).
32.IP " 4."
33No step should be a symbolic link inside a sticky directory and owned by
34another user.
35.PP
36The author is not aware of any weaknesses in this ruleset. The
37objective is that nobody other than the user and the superuser should be
38able to add or change the set of files available within the directories
39of the path(s).
40.SS Options
41The following command line options are available:
42.TP
43.B "\-h, \-\-help"
44Displays a relatively verbose message describing how to use
45.BR chkpath .
46.TP
47.B "\-V, \-\-version"
48Displays
49.BR chkpath 's
50version number.
51.TP
52.B "\-u, \-\-usage"
53Displays a very terse usage summary.
54.TP
55.B "\-v, \-\-verbose"
56Makes
57.B chkpath
58more verbose about what it's doing. This option has a cumulative
59effect, so put more in for more verbosity. Note that verbose doesn't
60mean the same as interesting. The default is to report problems with
61directories and system errors.
62.TP
63.B "\-q, \-\-quiet"
64Makes
65.B chkpath
66less verbose about what it's doing. This option, like
67.BR \-v ,
68has a cumulative effect. Each
69.B \-q
70cancels out a
71.B \-v
72option.
73.TP
74.B "\-s, \-\-sticky"
75Modifies the ruleset slightly so that any step through the filesystem is
76OK, even if world- or group-writable (but not owned by someone else), as
77long as the directory's sticky bit is set. The default is that sticky
78directories are considered safe only if they're not the final step.
79Turning this option on isn't recommended: if you use a sticky directory
80in your path then other people can add malicious commands whose names
81are common typos of standard ones.
82.TP
83.B "\-t, \-\-trust\-group"
84Modifies the ruleset slightly so that
85.B chkpath
86doesn't warn about directories group-owned by groups you're a member
87of. In other words, it trusts your fellow group-members
88.IR "in their capacity as group-owners only" :
89.B chkpath
90will still warn about directories owned by people in your groups.
91.TP
92.B "\-p, \-\-print"
93Writes on standard output a colon-separated list of the directories
94which
95.B chkpath
96considered `safe'. This can be used to filter out unsafe directories in
97an automatic way:
98.RS 10
99.nf
100.ft B
101.sp 1
102PATH=`chkpath -qqp`
103.ft R
104.fi
105.RE
106.SH BUGS
107None known.
108.SH SEE ALSO
109.BR tmpdir (1),
110.BR checkpath (3).
111.SH AUTHOR
112Mark Wooding (mdw@nsict.org).