Changeset 331 for trunk/src/samhain_hide.c
- Timestamp:
- Apr 21, 2011, 12:08:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/samhain_hide.c
r327 r331 112 112 /* #define READ_DEBUG */ /* read */ 113 113 /* #define PROC_DEBUG */ /* procfs */ 114 /* #define INIT_DEBUG */ /* module init */ 114 115 115 116 /***************************************************** … … 127 128 128 129 #if SH_KERNEL_NUMERIC >= KERNEL_VERSION(2,6,33) 129 #include < linux/generated/autoconf.h>130 #include <generated/autoconf.h> 130 131 #else 131 132 #if SH_KERNEL_NUMERIC >= KERNEL_VERSION(2,6,19) … … 874 875 { 875 876 877 #ifdef INIT_DEBUG 878 printk("INIT 0\n"); 879 #endif 880 876 881 lock_kernel(); 882 883 #ifdef INIT_DEBUG 884 printk("INIT 1\n"); 885 #endif 877 886 878 887 /* Unfortunately this does not fully prevent the module from appearing … … 883 892 #endif 884 893 894 #ifdef INIT_DEBUG 895 printk("INIT 1a (%d)\n", SYS_getdents); 896 #endif 897 885 898 /* Replace the 'sys_getdents' syscall with the new version. 886 899 */ 887 900 old_getdents = (void*) sh_sys_call_table[SYS_getdents]; 901 #ifdef INIT_DEBUG 902 printk("INIT 1b\n"); 903 #endif 888 904 sh_sys_call_table[SYS_getdents] = (unsigned long) new_getdents; 889 905 906 #ifdef INIT_DEBUG 907 printk("INIT 2\n"); 908 #endif 909 890 910 #ifdef __NR_getdents64 891 911 old_getdents64 = (void*) sh_sys_call_table[SYS_getdents64]; 892 912 sh_sys_call_table[SYS_getdents64] = (unsigned long) new_getdents64; 913 #endif 914 915 #ifdef INIT_DEBUG 916 printk("INIT 3\n"); 893 917 #endif 894 918 … … 909 933 910 934 #if SH_KERNEL_NUMERIC >= SH_KERNEL_MIN 935 #ifdef INIT_DEBUG 936 printk("INIT 4 0\n"); 937 #endif 911 938 mutex_lock(sh_module_mutex); 912 939 #endif 913 940 941 #ifdef INIT_DEBUG 942 printk("INIT 4 1\n"); 943 #endif 944 914 945 mod = sh_find_module(SH_INSTALL_NAME"_hide"); 946 947 #ifdef INIT_DEBUG 948 printk("INIT 4 2 (%d)\n", mod == 0 ? 0 : 1); 949 #endif 950 915 951 if (mod) { 916 952 /* Delete from various lists */ 917 953 #if defined(SH_MODLIST_LOCK) 954 #ifdef INIT_DEBUG 955 printk("INIT 4 3a\n"); 956 #endif 918 957 spin_lock_irq(modlist_lock); 958 #ifdef INIT_DEBUG 959 printk("INIT 4 3b\n"); 960 #endif 919 961 #endif 920 962 if (removeme == 1) 921 963 { 964 #ifdef INIT_DEBUG 965 printk("INIT 4 4a\n"); 966 #endif 922 967 list_del(&mod->list); 968 #ifdef INIT_DEBUG 969 printk("INIT 4 4b\n"); 970 #endif 923 971 } 924 972 #if defined(SH_MODLIST_LOCK) 973 #ifdef INIT_DEBUG 974 printk("INIT 4 5a\n"); 975 #endif 925 976 spin_unlock_irq(modlist_lock); 977 #ifdef INIT_DEBUG 978 printk("INIT 4 5b\n"); 979 #endif 926 980 #endif 927 981 } 982 928 983 #if SH_KERNEL_NUMERIC >= SH_KERNEL_MIN 929 mutex_unlock(sh_module_mutex); 984 #ifdef INIT_DEBUG 985 printk("INIT 4 6a\n"); 986 #endif 987 mutex_unlock(sh_module_mutex); 988 #ifdef INIT_DEBUG 989 printk("INIT 4 6b\n"); 990 #endif 930 991 #endif 931 992 } 932 993 #endif 933 994 995 #ifdef INIT_DEBUG 996 printk("INIT 4 7a\n"); 997 #endif 934 998 unlock_kernel(); 999 #ifdef INIT_DEBUG 1000 printk("INIT 4 7b\n"); 1001 #endif 935 1002 return (0); 936 1003 }
Note:
See TracChangeset
for help on using the changeset viewer.