*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: _secure_path | Section: 3 | Source: FreeBSD | File: _secure_path.3.gz
_SECURE_PATH(3) FreeBSD Library Functions Manual _SECURE_PATH(3) NAME _secure_path - determine if a file appears to be secure LIBRARY System Utilities Library (libutil, -lutil) SYNOPSIS #include <sys/types.h> #include <libutil.h> int _secure_path(const char *path, uid_t uid, gid_t gid); DESCRIPTION This function does some basic security checking on a given path. It is intended to be used by processes running with root privileges in order to decide whether or not to trust the contents of a given file. It uses a method often used to detect system compromise. A file is considered `secure' if it meets the following conditions: 1. The file exists, and is a regular file (not a symlink, device special or named pipe, etc.), 2. Is not world writable. 3. Is owned by the given uid or uid 0, if uid is not -1, 4. Is not group writable or it has group ownership by the given gid, if gid is not -1. RETURN VALUES This function returns zero if the file exists and may be considered secure, -2 if the file does not exist, and -1 otherwise to indicate a security failure. The syslog(3) function is used to log any failure of this function, including the reason, at LOG_ERR priority. SEE ALSO lstat(2), syslog(3) HISTORY Code from which this function was derived was contributed to the FreeBSD project by Berkeley Software Design, Inc. The function _secure_path() first appeared in FreeBSD 2.2.5. BUGS The checks carried out are rudimentary and no attempt is made to eliminate race conditions between use of this function and access to the file referenced. FreeBSD 14.1-RELEASE-p8 May 10, 2020 FreeBSD 14.1-RELEASE-p8

Navigation Options