xref: /minix3/lib/libutil/secure_path.3 (revision 0c3983b25a88161cf074524e5c94585a2582ae82)
1*0c3983b2SBen Gras.\"	$NetBSD: secure_path.3,v 1.10 2010/05/04 06:41:27 jruoho Exp $
2*0c3983b2SBen Gras.\"
3*0c3983b2SBen Gras.\" Copyright (c) 1996,1997 Berkeley Software Design, Inc. All rights reserved.
4*0c3983b2SBen Gras.\"
5*0c3983b2SBen Gras.\" Redistribution and use in source and binary forms, with or without
6*0c3983b2SBen Gras.\" modification, are permitted provided that the following conditions
7*0c3983b2SBen Gras.\" are met:
8*0c3983b2SBen Gras.\" 1. Redistributions of source code must retain the above copyright
9*0c3983b2SBen Gras.\"    notice, this list of conditions and the following disclaimer.
10*0c3983b2SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright
11*0c3983b2SBen Gras.\"    notice, this list of conditions and the following disclaimer in the
12*0c3983b2SBen Gras.\"    documentation and/or other materials provided with the distribution.
13*0c3983b2SBen Gras.\" 3. All advertising materials mentioning features or use of this software
14*0c3983b2SBen Gras.\"    must display the following acknowledgement:
15*0c3983b2SBen Gras.\"	This product includes software developed by Berkeley Software Design,
16*0c3983b2SBen Gras.\"	Inc.
17*0c3983b2SBen Gras.\" 4. The name of Berkeley Software Design, Inc.  may not be used to endorse
18*0c3983b2SBen Gras.\"    or promote products derived from this software without specific prior
19*0c3983b2SBen Gras.\"    written permission.
20*0c3983b2SBen Gras.\"
21*0c3983b2SBen Gras.\" THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND
22*0c3983b2SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23*0c3983b2SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24*0c3983b2SBen Gras.\" ARE DISCLAIMED.  IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE
25*0c3983b2SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26*0c3983b2SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27*0c3983b2SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28*0c3983b2SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29*0c3983b2SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30*0c3983b2SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31*0c3983b2SBen Gras.\" SUCH DAMAGE.
32*0c3983b2SBen Gras.\"
33*0c3983b2SBen Gras.\" from BSDI: login_cap.3,v 1.4 1997/11/07 16:22:27 jch Exp
34*0c3983b2SBen Gras.\"
35*0c3983b2SBen Gras.Dd May 4, 2010
36*0c3983b2SBen Gras.Dt SECURE_PATH 3
37*0c3983b2SBen Gras.Os
38*0c3983b2SBen Gras.Sh NAME
39*0c3983b2SBen Gras.Nm secure_path
40*0c3983b2SBen Gras.Nd determine if a file appears to be ``secure''
41*0c3983b2SBen Gras.Sh LIBRARY
42*0c3983b2SBen Gras.Lb libutil
43*0c3983b2SBen Gras.Sh SYNOPSIS
44*0c3983b2SBen Gras.In util.h
45*0c3983b2SBen Gras.Ft int
46*0c3983b2SBen Gras.Fn secure_path "const char *path"
47*0c3983b2SBen Gras.Sh DESCRIPTION
48*0c3983b2SBen GrasThe
49*0c3983b2SBen Gras.Fn secure_path
50*0c3983b2SBen Grasfunction takes a path name and returns zero if the referenced file is
51*0c3983b2SBen Gras.Dq secure ,
52*0c3983b2SBen Grasnon-zero if not.
53*0c3983b2SBen GrasAny
54*0c3983b2SBen Gras.Dq insecurity ,
55*0c3983b2SBen Grasother than failure to access
56*0c3983b2SBen Grasthe referenced file, will be logged to the system log.
57*0c3983b2SBen Gras.Pp
58*0c3983b2SBen GrasTo be
59*0c3983b2SBen Gras.Dq secure ,
60*0c3983b2SBen Grasthe referenced file must exist, be a regular file (and not a
61*0c3983b2SBen Grasdirectory), owned by the super-user, and writable only by the super-user.
62*0c3983b2SBen Gras.Sh SEE ALSO
63*0c3983b2SBen Gras.Xr openlog 3
64*0c3983b2SBen Gras.Sh HISTORY
65*0c3983b2SBen GrasThe
66*0c3983b2SBen Gras.Fn secure_path
67*0c3983b2SBen Grasfunction is based on the
68*0c3983b2SBen Gras.Bsx
69*0c3983b2SBen Grasimplementation of same, and appeared in
70*0c3983b2SBen Gras.Nx 1.5
71*0c3983b2SBen Grasby kind permission.
72