72 lines
1.8 KiB
Diff
72 lines
1.8 KiB
Diff
Index: trunk/src/samhain_hide.c
|
|
===================================================================
|
|
--- trunk/src/samhain_hide.c (revision 1)
|
|
+++ trunk/src/samhain_hide.c (revision 6)
|
|
@@ -318,4 +318,5 @@
|
|
int status = 0; /* Return value from original getdents */
|
|
struct inode * dir_inode;
|
|
+ struct file * fd_file;
|
|
int dir_is_proc = 0;
|
|
|
|
@@ -337,5 +338,5 @@
|
|
printk("STATUS %d\n", status);
|
|
#endif
|
|
-
|
|
+
|
|
/* 0: end of directory.
|
|
* -1: some error
|
|
@@ -346,11 +347,22 @@
|
|
return (status);
|
|
}
|
|
-
|
|
+
|
|
/* Handle directory caching. dir_inode is the inode of the directory.
|
|
*/
|
|
+#if defined(files_fdtable)
|
|
+ {
|
|
+ struct fdtable *fdt = files_fdtable(current->files);
|
|
+ fd_file = rcu_dereference(fdt->fd[fd]);
|
|
+ }
|
|
+#else
|
|
+ {
|
|
+ fd_file = current->files->fd[fd];
|
|
+ }
|
|
+#endif
|
|
+
|
|
#if defined(__LINUX_DCACHE_H)
|
|
- dir_inode = current->files->fd[fd]->f_dentry->d_inode;
|
|
+ dir_inode = fd_file->f_dentry->d_inode;
|
|
#else
|
|
- dir_inode = current->files->fd[fd]->f_inode;
|
|
+ dir_inode = fd_file->f_inode;
|
|
#endif
|
|
|
|
@@ -499,4 +511,5 @@
|
|
long status = 0; /* Return value from original getdents */
|
|
struct inode * dir_inode;
|
|
+ struct file * fd_file;
|
|
int dir_is_proc = 0;
|
|
|
|
@@ -530,8 +543,19 @@
|
|
/* Handle directory caching. dir_inode is the inode of the directory.
|
|
*/
|
|
+#if defined(files_fdtable)
|
|
+ {
|
|
+ struct fdtable *fdt = files_fdtable(current->files);
|
|
+ fd_file = rcu_dereference(fdt->fd[fd]);
|
|
+ }
|
|
+#else
|
|
+ {
|
|
+ fd_file = current->files->fd[fd];
|
|
+ }
|
|
+#endif
|
|
+
|
|
#if defined(__LINUX_DCACHE_H)
|
|
- dir_inode = current->files->fd[fd]->f_dentry->d_inode;
|
|
+ dir_inode = fd_file->f_dentry->d_inode;
|
|
#else
|
|
- dir_inode = current->files->fd[fd]->f_inode;
|
|
+ dir_inode = fd_file->f_inode;
|
|
#endif
|
|
|