Changeset 90 for trunk/src


Ignore:
Timestamp:
Feb 11, 2007, 11:02:54 PM (18 years ago)
Author:
rainer
Message:

Fix for ticket #50 (samhain_hide not compiling on 2.6.19).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/samhain_hide.c

    r51 r90  
    119119/* The configure options (#defines) for the Kernel
    120120 */
     121#if SH_KERNEL_NUMERIC >= 206019
     122#include <linux/autoconf.h>
     123#else
    121124#include <linux/config.h>
     125#endif
    122126
    123127#ifndef LINUX26
     
    164168 */
    165169#include <linux/smp_lock.h>
     170
     171#if SH_KERNEL_NUMERIC >= 206019
     172#include <linux/mutex.h>
     173#endif
    166174
    167175/* Include for fget().
     
    341349  long                 dirp_offset;
    342350
     351  unsigned long        dummy;
     352
    343353  lock_kernel();
    344354
     
    400410  /* Copy the dirp table to kernel space.
    401411   */
    402   copy_from_user(dirp_new, dirp, status);
     412  dummy = (unsigned long) copy_from_user(dirp_new, dirp, status);
    403413
    404414#ifdef FILE_DEBUG
     
    498508  /* Copy our modified dirp table back to user space.
    499509   */
    500   copy_to_user(dirp, dirp_new, status);
     510  dummy = (unsigned long) copy_to_user(dirp, dirp_new, status);
    501511#ifdef FILE_DEBUG
    502512  printk("COPY to user\n");
     
    534544  __s64                dirp_offset;
    535545
     546  unsigned long        dummy;
     547
    536548  lock_kernel();
    537549
     
    612624  /* Copy the dirp table to kernel space.
    613625   */
    614   copy_from_user(dirp_new, dirp, status);
     626  dummy = (unsigned long) copy_from_user(dirp_new, dirp, status);
    615627
    616628#ifdef FILE_DEBUG
     
    716728  /* Copy our modified dirp table back to user space.
    717729   */
    718   copy_to_user(dirp, dirp_new, status);
     730  dummy = (unsigned long) copy_to_user(dirp, dirp_new, status);
    719731  kfree (dirp_new);
    720732  unlock_kernel();
     
    768780#ifdef LINUX26
    769781  {
     782#if defined(SH_MODLIST_LOCK)
    770783    spinlock_t * modlist_lock = (spinlock_t * ) SH_MODLIST_LOCK;
    771     struct module *mod = find_module(SH_INSTALL_NAME"_hide");
     784#endif
     785#if SH_KERNEL_NUMERIC >= 206019
     786    struct mutex * module_mutex = (struct mutex *) SH_MODLIST_MUTEX;
     787#endif
     788
     789    struct module *mod;
     790
     791#if SH_KERNEL_NUMERIC >= 206019
     792    mutex_lock(module_mutex);
     793#endif
     794
     795    mod = find_module(SH_INSTALL_NAME"_hide");
    772796    if (mod) {
    773797      /* Delete from various lists */
     798#if defined(SH_MODLIST_LOCK)
    774799      spin_lock_irq(modlist_lock);
     800#endif
    775801      if (removeme == 1)
    776802        {
    777803          list_del(&mod->list);
    778804        }
     805#if defined(SH_MODLIST_LOCK)
    779806      spin_unlock_irq(modlist_lock);
     807#endif
    780808    }
     809#if SH_KERNEL_NUMERIC >= 206019
     810      mutex_unlock(module_mutex);
     811#endif
    781812  }
    782813#endif
Note: See TracChangeset for help on using the changeset viewer.