Index: /trunk/src/samhain_hide.c
===================================================================
--- /trunk/src/samhain_hide.c	(revision 330)
+++ /trunk/src/samhain_hide.c	(revision 331)
@@ -112,4 +112,5 @@
 /* #define READ_DEBUG  */   /* read         */
 /* #define PROC_DEBUG  */   /* procfs       */
+/* #define INIT_DEBUG  */   /* module init  */
 
 /*****************************************************
@@ -127,5 +128,5 @@
 
 #if SH_KERNEL_NUMERIC >= KERNEL_VERSION(2,6,33)
-#include <linux/generated/autoconf.h>
+#include <generated/autoconf.h>
 #else
 #if SH_KERNEL_NUMERIC >= KERNEL_VERSION(2,6,19)
@@ -874,5 +875,13 @@
 {
 
+#ifdef INIT_DEBUG
+  printk("INIT 0\n");
+#endif
+
   lock_kernel();
+
+#ifdef INIT_DEBUG
+  printk("INIT 1\n");
+#endif
 
   /* Unfortunately this does not fully prevent the module from appearing
@@ -883,12 +892,27 @@
 #endif
 
+#ifdef INIT_DEBUG
+  printk("INIT 1a (%d)\n", SYS_getdents);
+#endif
+
   /* Replace the 'sys_getdents' syscall with the new version.
    */
   old_getdents                        = (void*) sh_sys_call_table[SYS_getdents];
+#ifdef INIT_DEBUG
+  printk("INIT 1b\n");
+#endif
   sh_sys_call_table[SYS_getdents]     = (unsigned long) new_getdents;
   
+#ifdef INIT_DEBUG
+  printk("INIT 2\n");
+#endif
+
 #ifdef __NR_getdents64
   old_getdents64                      = (void*) sh_sys_call_table[SYS_getdents64];
   sh_sys_call_table[SYS_getdents64]   = (unsigned long) new_getdents64;
+#endif
+
+#ifdef INIT_DEBUG
+  printk("INIT 3\n");
 #endif
 
@@ -909,28 +933,71 @@
 
 #if SH_KERNEL_NUMERIC >= SH_KERNEL_MIN
+#ifdef INIT_DEBUG
+    printk("INIT 4 0\n");
+#endif
     mutex_lock(sh_module_mutex);
 #endif
 
+#ifdef INIT_DEBUG
+    printk("INIT 4 1\n");
+#endif
+
     mod = sh_find_module(SH_INSTALL_NAME"_hide");
+
+#ifdef INIT_DEBUG
+    printk("INIT 4 2 (%d)\n", mod == 0 ? 0 : 1);
+#endif
+
     if (mod) {
       /* Delete from various lists */
 #if defined(SH_MODLIST_LOCK)
+#ifdef INIT_DEBUG
+      printk("INIT 4 3a\n");
+#endif
       spin_lock_irq(modlist_lock);
+#ifdef INIT_DEBUG
+      printk("INIT 4 3b\n");
+#endif
 #endif
       if (removeme == 1)
 	{
+#ifdef INIT_DEBUG
+	  printk("INIT 4 4a\n");
+#endif
 	  list_del(&mod->list);
+#ifdef INIT_DEBUG
+	  printk("INIT 4 4b\n");
+#endif
 	}
 #if defined(SH_MODLIST_LOCK)
+#ifdef INIT_DEBUG
+	  printk("INIT 4 5a\n");
+#endif
       spin_unlock_irq(modlist_lock);
+#ifdef INIT_DEBUG
+	  printk("INIT 4 5b\n");
+#endif
 #endif
     }
+
 #if SH_KERNEL_NUMERIC >= SH_KERNEL_MIN
-      mutex_unlock(sh_module_mutex);
+#ifdef INIT_DEBUG
+    printk("INIT 4 6a\n");
+#endif
+    mutex_unlock(sh_module_mutex);
+#ifdef INIT_DEBUG
+    printk("INIT 4 6b\n");
+#endif
 #endif
   }
 #endif
 
+#ifdef INIT_DEBUG
+  printk("INIT 4 7a\n");
+#endif
   unlock_kernel();
+#ifdef INIT_DEBUG
+  printk("INIT 4 7b\n");
+#endif
   return (0);
 }
