Go to the source code of this file.
Functions | |
void | init_files () |
Initialize the programs file variables. | |
void | finalize_files () |
Remove temporary files. | |
time_t | get_timestamp (char *object, mode_t type) |
Get a object's last modified timestamp. | |
char * | find_rcfile () |
Search the system for the monit control file. | |
int | create_pidfile (char *pidfile) |
Create a program's pidfile - Such a file is created when in daemon mode. | |
int | check_rcfile (char *rcfile) |
Secure check the monitrc file. | |
int | isreg_file (char *file) |
Check if the file is a regular file. | |
int | exist_file (char *file) |
int | check_file (char *filename, char *description, int permmask) |
Security check for files. |
Definition in file files.c.
|
Security check for files. The files must have the same uid as the REAL uid of this process, it must have permissions no greater than "maxpermission" and it must not be a symbolic link. We check these conditions here.
Definition at line 275 of file files.c. References ASSERT, log(), prog, and STRERROR. Referenced by check_rcfile(). |
|
Secure check the monitrc file. The run control file must have the same uid as the REAL uid of this process, it must have permissions no greater than 700 and it must not be a symbolic link. We check these conditions here.
Definition at line 224 of file files.c. References ASSERT, and check_file(). |
|
Create a program's pidfile - Such a file is created when in daemon mode. The file is created with mask = PIDMASK (usually 644).
|
|
Definition at line 254 of file files.c. References ASSERT. Referenced by find_rcfile(), and get_pid(). |
|
Remove temporary files.
Definition at line 101 of file files.c. References myrun::pidfile, and Run. |
|
Search the system for the monit control file. Try first ~/.monitrc, if that fails try ./monitrc and finally /etc/monitrc. Exit the application if the control file is not found.
Definition at line 150 of file files.c. References myrun::myenvironment::cwd, myrun::Env, exist_file(), myrun::myenvironment::home, log(), MONITRC, prog, Run, and xmalloc(). |
|
Get a object's last modified timestamp.
Definition at line 115 of file files.c. References ASSERT, log(), MAXIMUM, and prog. Referenced by get_process_uptime(). |
|
Initialize the programs file variables.
Definition at line 73 of file files.c. References myrun::Env, myrun::myenvironment::home, MYPIDDIR, MYPIDFILE, myrun::pidfile, Run, and xstrdup(). |
|
Check if the file is a regular file.
Definition at line 238 of file files.c. References ASSERT. Referenced by get_md5sum(), and get_pid(). |