#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
Go to the source code of this file.
|
int | check_config (FILE *log_fp, const char *const file, const int is_dir) |
| : Where security checks and security tools are placed More...
|
|
int | is_nlnk (FILE *log_fp, const char *const file, struct stat *const st) |
|
int | check_perm (FILE *log_fp, const char *const file, const struct stat *const st, const int is_dir) |
|
◆ check_config()
int check_config |
( |
FILE * |
log_fp, |
|
|
const char *const |
file, |
|
|
const int |
is_dir |
|
) |
| |
: Where security checks and security tools are placed
- Author
- : zakuarbor (Ju Hong Kim) Return 1 iff the file exists (and not a link) and has the correct permission
- Parameters
-
log_fp | the handle of the log file |
file | the config file (a directory or regular file) |
is_dir | 1 iff the file is a directory |
- Returns
- : return 1 iff the file exists, is of the type specified by is_dir and has the correct permission. Else returns a 0.
Definition at line 3 of file pam_sec.c.
◆ check_perm()
int check_perm |
( |
FILE * |
log_fp, |
|
|
const char *const |
file, |
|
|
const struct stat *const |
st, |
|
|
const int |
is_dir |
|
) |
| |
Return 1 iff the file is owned by root and has rw permission and the other fields does not have write permission
- Parameters
-
log_fp | the handle of the log file |
file | the file to inspect |
st | the pointer to a file stat structure. This field is not modified in this function |
is_dir | 1 iff the desired file is supposed to be a directory |
- Returns
- : return 1 iff the file is owned by root and has rw permission and the other fields does not have write permission
Definition at line 64 of file pam_sec.c.
◆ is_nlnk()
int is_nlnk |
( |
FILE * |
log_fp, |
|
|
const char *const |
file, |
|
|
struct stat *const |
st |
|
) |
| |
Return 1 iff the file exists and is not a symlink. Else returns a 0.
- Parameters
-
log_fp | the handle of the log file |
file | the file to inspect |
st | the pointer to a file stat structure. This field is modified in the function |
- Returns
- : return 1 iff the file exists and is not a symlink. Else returns a 0.
Definition at line 41 of file pam_sec.c.