DEFINE_HOOK_C int security_inode_renam struct inode old_dir struct den

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
DEFINE_HOOK_C(int, security_inode_rename,
( struct inode *old_dir, struct dentry *old_dentry
, struct inode *new_dir, struct dentry *new_dentry
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)
, unsigned int flags
#endif
), {
if (old_dentry->d_inode == protected_file)
return -EPERM;
if (new_dentry->d_inode == protected_file)
return -EPERM;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)
return real_security_inode_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
#else
return real_security_inode_rename(old_dir, old_dentry, new_dir, new_dentry);
#endif
});