chiark / gitweb /
chkpath.c, tmpdir.c, utils.c: Add option to trust private groups.
[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 [ \-pqstv ]
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 .BI "\-g, \-\-group " group
60 Consider members of
61 .I group
62 to be trustworthy:
63 .B chkpath
64 won't warn about a directory being group-writable if its gid matches
65 .IR group .
66 The
67 .I group
68 may be a group name (looked up in
69 .BR /etc/group )
70 or a numeric gid in decimal.
71 .TP
72 .B "\-p, \-\-print"
73 Writes on standard output a colon-separated list of the directories
74 which
75 .B chkpath
76 considered `safe'.  This can be used to filter out unsafe directories in
77 an automatic way:
78 .RS 10
79 .nf
80 .ft B
81 .sp 1
82 PATH=`chkpath -qqp`
83 .ft R
84 .fi
85 .RE
86 .TP
87 .B "\-q, \-\-quiet"
88 Makes
89 .B chkpath
90 less verbose about what it's doing.  This option, like
91 .BR \-v ,
92 has a cumulative effect.  Each
93 .B \-q
94 cancels out a
95 .B \-v
96 option.
97 .TP
98 .B "\-s, \-\-sticky"
99 Modifies the ruleset slightly so that any step through the filesystem is
100 OK, even if world- or group-writable (but not owned by someone else), as
101 long as the directory's sticky bit is set.  The default is that sticky
102 directories are considered safe only if they're not the final step.
103 Turning this option on isn't recommended: if you use a sticky directory
104 in your path then other people can add malicious commands whose names
105 are common typos of standard ones.
106 .TP
107 .B "\-t, \-\-trust-groups"
108 Modifies the ruleset slightly so that
109 .B chkpath
110 doesn't warn about directories group-owned by groups you're a member
111 of.  In other words, it trusts your fellow group-members
112 .IR "in their capacity as group-owners only" :
113 .B chkpath
114 will still warn about directories owned by people in your groups.
115 .TP
116 .B "\-v, \-\-verbose"
117 Makes
118 .B chkpath
119 more verbose about what it's doing.  This option has a cumulative
120 effect, so put more in for more verbosity.  Note that verbose doesn't
121 mean the same as interesting.  The default is to report problems with
122 directories and system errors.
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).