Added a logfile
This commit is contained in:
		@@ -35,9 +35,13 @@ struct dialogue_response {
 | 
			
		||||
  char *filename;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
FILE *access_log;
 | 
			
		||||
 | 
			
		||||
int init_ui_socket(const char *perm_permissions_db_filename) {
 | 
			
		||||
  FILE *fp = NULL;
 | 
			
		||||
 | 
			
		||||
  access_log = fopen("/etc/icfs-log", "a+");
 | 
			
		||||
 | 
			
		||||
  if (init_temp_permissions_table()) {
 | 
			
		||||
    fprintf(stderr, "Could not initialize temporary permissions table.\n");
 | 
			
		||||
    return 1;
 | 
			
		||||
@@ -60,6 +64,7 @@ int init_ui_socket(const char *perm_permissions_db_filename) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void destroy_ui_socket(void) {
 | 
			
		||||
  fclose(access_log);
 | 
			
		||||
  destroy_temp_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)));
 | 
			
		||||
  cleanup(&dialogue_output);
 | 
			
		||||
  time_t now = time(0);
 | 
			
		||||
  fprintf(access_log, "%ld\n", now);
 | 
			
		||||
 | 
			
		||||
  if (dialogue_exit_code == (DIALOGUE_YES | DIALOGUE_PERM)) {
 | 
			
		||||
    response.decision = ALLOW;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user