Commit b2fccabc authored by Hongtao Lyu's avatar Hongtao Lyu
Browse files

update 4

parent 202da9d0
......@@ -1159,7 +1159,12 @@ struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt,
return do_file_open_root(dentry, mnt, filename, &op);
}
EXPORT_SYMBOL(file_open_root);
//////////////////////////////////
//const char* default_sBPF_openat_prog(const char * filename){
// return filename;
//}
////////////////////////////////////
static long do_sys_openat2(int dfd, const char __user *filename,
struct open_how *how)
{
......@@ -1171,10 +1176,10 @@ static long do_sys_openat2(int dfd, const char __user *filename,
return fd;
///////////////////////////////changing here
if(flag_of_sBPF==0){
if(flag_openat_sBPF==0){
tmp = getname(filename);
}else{
const char* new_filename=sBPF_hook_prog(filename);
const char* new_filename=sBPF_hook_openat_prog(filename);
tmp = getname(new_filename);
}
////////////////////////////////////
......
......@@ -86,12 +86,12 @@ extern int sysctl_protected_regular;
/////////////////changing here
const char* default_sBPF_prog(const char * filename){
const char* default_sBPF_openat_prog(const char * filename){
return filename;
}
int flag_of_sBPF=0;
const char* (*sBPF_hook_prog)(const char * filename)=default_sBPF_prog;
int flag_openat_sBPF=0;
const char* (*sBPF_hook_openat_prog)(const char * filename)=default_sBPF_openat_prog;
/////////////////////////////////
......
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