ProxyAuth
Linux PAM to authenticate device via Bluetooth device
Functions
pam_sec.h File Reference
#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>
Include dependency graph for pam_sec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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)
 

Function Documentation

◆ 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_fpthe handle of the log file
filethe config file (a directory or regular file)
is_dir1 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.

Here is the call graph for this function:

◆ 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_fpthe handle of the log file
filethe file to inspect
stthe pointer to a file stat structure. This field is not modified in this function
is_dir1 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_fpthe handle of the log file
filethe file to inspect
stthe 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.