ProxyAuth
Linux PAM to authenticate device via Bluetooth device
|
#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.
Functions | |
void | get_login_time (char *curr_time) |
int | get_num_lines (FILE *fp) |
int | check_or_creat_dir (const char *dir_path, FILE *log_fp) |
int check_or_creat_dir | ( | const char * | dir_path, |
FILE * | log_fp | ||
) |
Check if the directory exists. If not try to create the directory
dir_path | The path to the directory |
log_fp | the handle of the log file |
Definition at line 37 of file pam_misc.c.
void get_login_time | ( | char * | curr_time | ) |
Set the login time to the given pointer
Format: a b d H:M:S Y
Example: Fri Feb 11 02:59:18 2020
a: locale's abbreviated weekday name (e.g., Sun)
b: locale's abbreviated month name (e.g., Jan)
d: day of month (e.g., 01)
H: hour (00..23)
M: minute (00..59)
S: second (00..60)
Y: year
Credits: man date
for the format specifier
curr_time | a pointer to store the current time |
Definition at line 3 of file pam_misc.c.
int get_num_lines | ( | FILE * | fp | ) |
Return the number of lines there are in the file
Use Case: Each user will have a list of trusted bluetooth MAC stored in a file. E Each line will contain a trusted bluetooth MAC address. The number of lines in the file will represent the number of trusted devices
FILE | *fp: the file handle that contains the user's device |
Definition at line 13 of file pam_misc.c.