kernel: ksud: Adapt ksu_handle_vfs_read, d_is_reg isn't available in kernels < 4.0

Co-Authored-By: backslashxx <118538522+backslashxx@users.noreply.github.com>
This commit is contained in:
Trijal Saha
2025-05-07 16:54:29 -04:00
committed by Rifat Azad
parent 34315deaba
commit b368127aff

View File

@@ -360,7 +360,11 @@ int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr,
return 0;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
if (!d_is_reg(file->f_path.dentry)) {
#else
if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) {
#endif
return 0;
}