Added a logfile
This commit is contained in:
parent
c7ec5819c6
commit
4febeb7a82
@ -35,9 +35,13 @@ struct dialogue_response {
|
|||||||
char *filename;
|
char *filename;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FILE *access_log;
|
||||||
|
|
||||||
int init_ui_socket(const char *perm_permissions_db_filename) {
|
int init_ui_socket(const char *perm_permissions_db_filename) {
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
|
|
||||||
|
access_log = fopen("/etc/icfs-log", "a+");
|
||||||
|
|
||||||
if (init_temp_permissions_table()) {
|
if (init_temp_permissions_table()) {
|
||||||
fprintf(stderr, "Could not initialize temporary permissions table.\n");
|
fprintf(stderr, "Could not initialize temporary permissions table.\n");
|
||||||
return 1;
|
return 1;
|
||||||
@ -60,6 +64,7 @@ int init_ui_socket(const char *perm_permissions_db_filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void destroy_ui_socket(void) {
|
void destroy_ui_socket(void) {
|
||||||
|
fclose(access_log);
|
||||||
destroy_temp_permissions_table();
|
destroy_temp_permissions_table();
|
||||||
destroy_perm_permissions_table();
|
destroy_perm_permissions_table();
|
||||||
}
|
}
|
||||||
@ -137,6 +142,8 @@ struct dialogue_response ask_access(const char *filename,
|
|||||||
|
|
||||||
// assert(0 == strcmp(response.filename, first(&dialogue_output)));
|
// assert(0 == strcmp(response.filename, first(&dialogue_output)));
|
||||||
cleanup(&dialogue_output);
|
cleanup(&dialogue_output);
|
||||||
|
time_t now = time(0);
|
||||||
|
fprintf(access_log, "%ld\n", now);
|
||||||
|
|
||||||
if (dialogue_exit_code == (DIALOGUE_YES | DIALOGUE_PERM)) {
|
if (dialogue_exit_code == (DIALOGUE_YES | DIALOGUE_PERM)) {
|
||||||
response.decision = ALLOW;
|
response.decision = ALLOW;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user