1*45b87028Sjruoho.\" $NetBSD: secure_path.3,v 1.10 2010/05/04 06:41:27 jruoho Exp $ 2b596a9b1Sitojun.\" 3b596a9b1Sitojun.\" Copyright (c) 1996,1997 Berkeley Software Design, Inc. All rights reserved. 4b596a9b1Sitojun.\" 5b596a9b1Sitojun.\" Redistribution and use in source and binary forms, with or without 6b596a9b1Sitojun.\" modification, are permitted provided that the following conditions 7b596a9b1Sitojun.\" are met: 8b596a9b1Sitojun.\" 1. Redistributions of source code must retain the above copyright 9b596a9b1Sitojun.\" notice, this list of conditions and the following disclaimer. 10b596a9b1Sitojun.\" 2. Redistributions in binary form must reproduce the above copyright 11b596a9b1Sitojun.\" notice, this list of conditions and the following disclaimer in the 12b596a9b1Sitojun.\" documentation and/or other materials provided with the distribution. 13b596a9b1Sitojun.\" 3. All advertising materials mentioning features or use of this software 14b596a9b1Sitojun.\" must display the following acknowledgement: 15b596a9b1Sitojun.\" This product includes software developed by Berkeley Software Design, 16b596a9b1Sitojun.\" Inc. 17b596a9b1Sitojun.\" 4. The name of Berkeley Software Design, Inc. may not be used to endorse 18b596a9b1Sitojun.\" or promote products derived from this software without specific prior 19b596a9b1Sitojun.\" written permission. 20b596a9b1Sitojun.\" 21b596a9b1Sitojun.\" THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND 22b596a9b1Sitojun.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23b596a9b1Sitojun.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24b596a9b1Sitojun.\" ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE 25b596a9b1Sitojun.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26b596a9b1Sitojun.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27b596a9b1Sitojun.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28b596a9b1Sitojun.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29b596a9b1Sitojun.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30b596a9b1Sitojun.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31b596a9b1Sitojun.\" SUCH DAMAGE. 32b596a9b1Sitojun.\" 33300fe580Sad.\" from BSDI: login_cap.3,v 1.4 1997/11/07 16:22:27 jch Exp 34b596a9b1Sitojun.\" 35*45b87028Sjruoho.Dd May 4, 2010 36b596a9b1Sitojun.Dt SECURE_PATH 3 37b596a9b1Sitojun.Os 38b596a9b1Sitojun.Sh NAME 39b596a9b1Sitojun.Nm secure_path 40300fe580Sad.Nd determine if a file appears to be ``secure'' 41b596a9b1Sitojun.Sh LIBRARY 42b596a9b1Sitojun.Lb libutil 43b596a9b1Sitojun.Sh SYNOPSIS 44472351e1Swiz.In util.h 45b596a9b1Sitojun.Ft int 468b2c9134Sad.Fn secure_path "const char *path" 47b596a9b1Sitojun.Sh DESCRIPTION 48b596a9b1SitojunThe 49b596a9b1Sitojun.Fn secure_path 50300fe580Sadfunction takes a path name and returns zero if the referenced file is 51149ced91Swiz.Dq secure , 5227adb020Swiznon-zero if not. 5327adb020SwizAny 54149ced91Swiz.Dq insecurity , 55149ced91Swizother than failure to access 56300fe580Sadthe referenced file, will be logged to the system log. 57300fe580Sad.Pp 58149ced91SwizTo be 59149ced91Swiz.Dq secure , 60149ced91Swizthe referenced file must exist, be a regular file (and not a 61300fe580Saddirectory), owned by the super-user, and writable only by the super-user. 62300fe580Sad.Sh SEE ALSO 63300fe580Sad.Xr openlog 3 64b596a9b1Sitojun.Sh HISTORY 65b596a9b1SitojunThe 66*45b87028Sjruoho.Fn secure_path 6782759dbdSadfunction is based on the 6882759dbdSad.Bsx 6982759dbdSadimplementation of same, and appeared in 70b596a9b1Sitojun.Nx 1.5 71b596a9b1Sitojunby kind permission. 72