Changeset 6 for trunk


Ignore:
Timestamp:
Dec 25, 2005, 9:26:06 PM (19 years ago)
Author:
rainer
Message:

Fix samhain_hide for kernel 2.6.14

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/samhain_hide.c

    r1 r6  
    318318  int                  status = 0;    /* Return value from original getdents */
    319319  struct inode       * dir_inode;
     320  struct file        * fd_file;
    320321  int                  dir_is_proc = 0;
    321322
     
    337338  printk("STATUS %d\n", status);
    338339#endif
    339 
     340 
    340341  /*  0: end of directory.
    341342   * -1: some error
     
    346347      return (status);
    347348    }
    348 
     349 
    349350  /* Handle directory caching. dir_inode is the inode of the directory.
    350351   */
     352#if defined(files_fdtable)
     353  {
     354    struct fdtable *fdt = files_fdtable(current->files);
     355    fd_file = rcu_dereference(fdt->fd[fd]);
     356  }
     357#else
     358  {
     359    fd_file = current->files->fd[fd];
     360  }
     361#endif
     362 
    351363#if defined(__LINUX_DCACHE_H)
    352   dir_inode  = current->files->fd[fd]->f_dentry->d_inode;
     364  dir_inode  = fd_file->f_dentry->d_inode;
    353365#else
    354   dir_inode  = current->files->fd[fd]->f_inode;
     366  dir_inode  = fd_file->f_inode;
    355367#endif
    356368
     
    499511  long                 status = 0;    /* Return value from original getdents */
    500512  struct inode       * dir_inode;
     513  struct file        * fd_file;
    501514  int                  dir_is_proc = 0;
    502515
     
    530543  /* Handle directory caching. dir_inode is the inode of the directory.
    531544   */
     545#if defined(files_fdtable)
     546  {
     547    struct fdtable *fdt = files_fdtable(current->files);
     548    fd_file = rcu_dereference(fdt->fd[fd]);
     549  }
     550#else
     551  {
     552    fd_file = current->files->fd[fd];
     553  }
     554#endif
     555
    532556#if defined(__LINUX_DCACHE_H)
    533   dir_inode  = current->files->fd[fd]->f_dentry->d_inode;
     557  dir_inode  = fd_file->f_dentry->d_inode;
    534558#else
    535   dir_inode  = current->files->fd[fd]->f_inode;
     559  dir_inode  = fd_file->f_inode;
    536560#endif
    537561
Note: See TracChangeset for help on using the changeset viewer.