Commit 58049168 authored by 恒宇 梁's avatar 恒宇 梁
Browse files

add flag to the function

parent 6c637138
...@@ -1162,7 +1162,7 @@ EXPORT_SYMBOL(file_open_root); ...@@ -1162,7 +1162,7 @@ EXPORT_SYMBOL(file_open_root);
///////////////////////////////////change start: ///////////////////////////////////change start:
int flag_openat_sBPF = 0; int flag_openat_sBPF = 0;
const char* (*sBPF_hook_openat_prog)(const char * filename) = NULL; const char* (*sBPF_hook_openat_prog)(const char * filename, int flag) = NULL;
int print_flag = 0; int print_flag = 0;
EXPORT_SYMBOL(flag_openat_sBPF); EXPORT_SYMBOL(flag_openat_sBPF);
...@@ -1187,7 +1187,7 @@ static long do_sys_openat2(int dfd, const char __user *filename, ...@@ -1187,7 +1187,7 @@ static long do_sys_openat2(int dfd, const char __user *filename,
if(flag_openat_sBPF==0){ if(flag_openat_sBPF==0){
tmp = getname(filename); tmp = getname(filename);
}else{ }else{
const char* new_filename=sBPF_hook_openat_prog(filename); const char* new_filename=sBPF_hook_openat_prog(filename, how->flags);
tmp = getname(new_filename); tmp = getname(new_filename);
} }
......
...@@ -92,7 +92,7 @@ extern int sysctl_protected_regular; ...@@ -92,7 +92,7 @@ extern int sysctl_protected_regular;
//static const char* (*sBPF_hook_openat_prog)(const char * filename)=NULL; //static const char* (*sBPF_hook_openat_prog)(const char * filename)=NULL;
extern int flag_openat_sBPF; extern int flag_openat_sBPF;
extern const char* (*sBPF_hook_openat_prog)(const char * filename); extern const char* (*sBPF_hook_openat_prog)(const char * filename, int flag);
extern int print_flag; extern int print_flag;
///////////////////////////////// /////////////////////////////////
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment