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