Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

secure_path(3) [netbsd man page]

SECURE_PATH(3)						   BSD 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 <util.h> int secure_path(const char *path); DESCRIPTION
The secure_path() function takes a path name and returns zero if the referenced file is ``secure'', non-zero if not. Any ``insecurity'', other than failure to access the referenced file, will be logged to the system log. To be ``secure'', the referenced file must exist, be a regular file (and not a directory), owned by the super-user, and writable only by the super-user. SEE ALSO
openlog(3) HISTORY
The secure_path() function is based on the BSD/OS implementation of same, and appeared in NetBSD 1.5 by kind permission. BSD
May 4, 2010 BSD

Check Out this Related Man Page

PIDFILE(3)						   BSD Library Functions Manual 						PIDFILE(3)

NAME
pidfile -- write a daemon pid file LIBRARY
System Utilities Library (libutil, -lutil) SYNOPSIS
#include <util.h> int pidfile(const char *path); DESCRIPTION
pidfile() creates a file containing the process ID of the caller program. The pid file can be used as a quick reference if the process needs to be sent a signal. When the program exits, the pid file is removed automatically, unless the program receives a fatal signal. If path is NULL or a plain basename (a name containing no directory components), the pid file is created in the /var/run directory. The file name has the form /var/run/basename.pid. The basename part is either the value of path if it was not NULL, or the program name as returned by getprogname(3) otherwise. If path is an absolute or relative path (i.e. it contains the '/' character), the pid file is created in the provided location. Note that only the first invocation of pidfile() causes a pid file to be written; subsequent invocations have no effect unless a new path is supplied. If called with a new path, pidfile() will remove the old pid file and write the new one. RETURN VALUES
pidfile() returns 0 on success and -1 on failure. SEE ALSO
atexit(3) HISTORY
The pidfile() function call appeared in NetBSD 1.5. Support for creating pid files in any arbitrary path was added in NetBSD 6.0. BUGS
pidfile() uses atexit(3) to ensure the pid file is unlinked at program exit. However, programs that use the _exit(2) function (for example, in signal handlers) will not trigger this behaviour. BSD
March 23, 2011 BSD
Man Page