Moved permission table logic to a separate file
This commit is contained in:
@@ -13,18 +13,31 @@
|
||||
#ifndef UI_SOCKET_H
|
||||
#define UI_SOCKET_H
|
||||
|
||||
#include "process_info.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
struct process_info {
|
||||
pid_t PID;
|
||||
const char *name;
|
||||
uid_t UID;
|
||||
};
|
||||
/**
|
||||
* Initialize the GUI communication.
|
||||
*
|
||||
* @return: 0 on success, -1 on faliure.
|
||||
*/
|
||||
int init_ui_socket(void);
|
||||
|
||||
int init_ui_socket();
|
||||
|
||||
void destroy_ui_socket();
|
||||
/**
|
||||
* Close the GUI communication.
|
||||
*/
|
||||
void destroy_ui_socket(void);
|
||||
|
||||
/**
|
||||
* Check access according to:
|
||||
* 1. temporary permission table
|
||||
* 2. permanent permission table
|
||||
* 3. user descision
|
||||
*
|
||||
* @param filename: The file that the process is trying to access
|
||||
* @pram pi: The process information
|
||||
* @return: 0 if access is denied, 1 if access is allowed
|
||||
*/
|
||||
int interactive_access(const char *filename, struct process_info pi);
|
||||
|
||||
#endif // !UI_SOCKET_H
|
||||
|
Reference in New Issue
Block a user