xref: /freebsd/usr.bin/pathchk/pathchk.1 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1c78c4633STim J. Robbins.\" Copyright (c) 2001, 2002 Chuck Rouillard
2c78c4633STim J. Robbins.\" All rights reserved.
3c78c4633STim J. Robbins.\"
4c78c4633STim J. Robbins.\" Redistribution and use in source and binary forms, with or without
5c78c4633STim J. Robbins.\" modification, are permitted provided that the following conditions
6c78c4633STim J. Robbins.\" are met:
7c78c4633STim J. Robbins.\" 1. Redistributions of source code must retain the above copyright
8c78c4633STim J. Robbins.\"    notice, this list of conditions and the following disclaimer.
9c78c4633STim J. Robbins.\" 2. Redistributions in binary form must reproduce the above copyright
10c78c4633STim J. Robbins.\"    notice, this list of conditions and the following disclaimer in the
11c78c4633STim J. Robbins.\"    documentation and/or other materials provided with the distribution.
12c78c4633STim J. Robbins.\" 3. The name of the author may not be used to endorse or promote
13c78c4633STim J. Robbins.\"    products derived from this software without specific prior written
14c78c4633STim J. Robbins.\"    permission.
15c78c4633STim J. Robbins.\"
16c78c4633STim J. Robbins.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
17c78c4633STim J. Robbins.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18c78c4633STim J. Robbins.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19c78c4633STim J. Robbins.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20c78c4633STim J. Robbins.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21c78c4633STim J. Robbins.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22c78c4633STim J. Robbins.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23c78c4633STim J. Robbins.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24c78c4633STim J. Robbins.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25c78c4633STim J. Robbins.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26c78c4633STim J. Robbins.\" SUCH DAMAGE.
27c78c4633STim J. Robbins.\"
28da219525SJilles Tjoelker.Dd May 1, 2010
29c78c4633STim J. Robbins.Dt PATHCHK 1
30c78c4633STim J. Robbins.Os
31c78c4633STim J. Robbins.Sh NAME
32c78c4633STim J. Robbins.Nm pathchk
33c78c4633STim J. Robbins.Nd check pathnames
34c78c4633STim J. Robbins.Sh SYNOPSIS
353c7cf139SRuslan Ermilov.Nm
36da219525SJilles Tjoelker.Op Fl pP
373c7cf139SRuslan Ermilov.Ar pathname ...
38c78c4633STim J. Robbins.Sh DESCRIPTION
39c78c4633STim J. RobbinsThe
403c7cf139SRuslan Ermilov.Nm
41c78c4633STim J. Robbinsutility checks whether each of the specified
42c78c4633STim J. Robbins.Ar pathname
43c78c4633STim J. Robbinsarguments is valid or portable.
44c78c4633STim J. Robbins.Pp
45c78c4633STim J. RobbinsA diagnostic message is written for each argument that:
46c78c4633STim J. Robbins.Bl -bullet
47c78c4633STim J. Robbins.It
48c78c4633STim J. RobbinsIs longer than
49c78c4633STim J. Robbins.Dv PATH_MAX
50c78c4633STim J. Robbinsbytes.
51c78c4633STim J. Robbins.It
52c78c4633STim J. RobbinsContains any component longer than
53c78c4633STim J. Robbins.Dv NAME_MAX
54c78c4633STim J. Robbinsbytes.
553c7cf139SRuslan Ermilov(The value of
56c78c4633STim J. Robbins.Dv NAME_MAX
573c7cf139SRuslan Ermilovdepends on the underlying file system.)
58c78c4633STim J. Robbins.It
59c78c4633STim J. RobbinsContains a directory component that is not searchable.
60c78c4633STim J. Robbins.El
61c78c4633STim J. Robbins.Pp
62c78c4633STim J. RobbinsIt is not considered an error if a
63c78c4633STim J. Robbins.Ar pathname
64c78c4633STim J. Robbinsargument contains a nonexistent component as long as a component by that
65c78c4633STim J. Robbinsname could be created.
66c78c4633STim J. Robbins.Pp
67c78c4633STim J. RobbinsThe options are as follows:
68c78c4633STim J. Robbins.Bl -tag -width indent
69c78c4633STim J. Robbins.It Fl p
70c78c4633STim J. RobbinsPerform portability checks on the specified
71c78c4633STim J. Robbins.Ar pathname
72c78c4633STim J. Robbinsarguments.
73c78c4633STim J. RobbinsDiagnostic messages will be written for each argument that:
74c78c4633STim J. Robbins.Bl -bullet
75c78c4633STim J. Robbins.It
76c78c4633STim J. RobbinsIs longer than
77c78c4633STim J. Robbins.Dv _POSIX_PATH_MAX
78c78c4633STim J. Robbins.Pq 255
79c78c4633STim J. Robbinsbytes.
80c78c4633STim J. Robbins.It
81c78c4633STim J. RobbinsContains a component longer than
82c78c4633STim J. Robbins.Dv _POSIX_NAME_MAX
83c78c4633STim J. Robbins.Pq 14
84c78c4633STim J. Robbinsbytes.
85c78c4633STim J. Robbins.It
86c78c4633STim J. RobbinsContains any character not in the portable filename character set (that is,
87c78c4633STim J. Robbinsalphanumeric characters,
88c78c4633STim J. Robbins.Ql \&. ,
89c78c4633STim J. Robbins.Ql \&-
90c78c4633STim J. Robbinsand
913c7cf139SRuslan Ermilov.Ql _ ) .
92c78c4633STim J. RobbinsNo component may start with the hyphen
93c78c4633STim J. Robbins.Pq Ql \&-
94c78c4633STim J. Robbinscharacter.
95c78c4633STim J. Robbins.El
96da219525SJilles Tjoelker.It Fl P
97da219525SJilles TjoelkerIn addition to the default or
98da219525SJilles Tjoelker.Fl p
99da219525SJilles Tjoelkerchecks, write a diagnostic for each argument that:
100da219525SJilles Tjoelker.Bl -bullet
101da219525SJilles Tjoelker.It
102da219525SJilles TjoelkerIs empty.
103da219525SJilles Tjoelker.It
104da219525SJilles TjoelkerContains a component that starts with a hyphen.
105da219525SJilles Tjoelker.El
106c78c4633STim J. Robbins.El
1076c7216dfSRuslan Ermilov.Sh EXIT STATUS
1086c7216dfSRuslan Ermilov.Ex -std
109c78c4633STim J. Robbins.Sh EXAMPLES
110c78c4633STim J. RobbinsCheck whether the names of files in the current directory are portable to
111c78c4633STim J. Robbinsother
112c78c4633STim J. Robbins.Tn POSIX
113c78c4633STim J. Robbinssystems:
1143c7cf139SRuslan Ermilov.Pp
115*8f3bd466SJilles Tjoelker.Dl "find . -exec pathchk -p -- {} +"
116c78c4633STim J. Robbins.Sh SEE ALSO
117c78c4633STim J. Robbins.Xr getconf 1 ,
118c78c4633STim J. Robbins.Xr pathconf 2 ,
119c78c4633STim J. Robbins.Xr stat 2
120c78c4633STim J. Robbins.Sh STANDARDS
121c78c4633STim J. RobbinsThe
1223c7cf139SRuslan Ermilov.Nm
123c78c4633STim J. Robbinsutility conforms to
124c78c4633STim J. Robbins.St -p1003.1-2001 .
125c78c4633STim J. Robbins.Sh HISTORY
126c78c4633STim J. RobbinsA
127c78c4633STim J. Robbins.Nm
128c78c4633STim J. Robbinsutility appeared in
129c78c4633STim J. Robbins.Fx 5.0 .
130