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