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 | is_rcfile_changed () |
Test the monit control file for changes. | |
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 284 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 233 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 263 of file files.c. References ASSERT. Referenced by find_rcfile(), and get_pid(). |
|
Remove temporary files.
Definition at line 98 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 147 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 112 of file files.c. References ASSERT, log(), MAXIMUM, and prog. Referenced by get_process_uptime(), init_files(), and is_rcfile_changed(). |
|
Initialize the programs file variables.
Definition at line 68 of file files.c. References myrun::controlfile, myrun::Env, get_timestamp(), myrun::myenvironment::home, MYPIDDIR, MYPIDFILE, myrun::pidfile, Run, myrun::timestamp, and xstrdup(). |
|
Test the monit control file for changes.
Definition at line 218 of file files.c. References myrun::controlfile, get_timestamp(), Run, and myrun::timestamp. |
|
Check if the file is a regular file.
Definition at line 247 of file files.c. References ASSERT. Referenced by get_md5sum(), and get_pid(). |