Index: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in	(revision 583)
+++ trunk/Makefile.in	(revision 1)
@@ -1,20 +1,6 @@
-#
-# Copyright Rainer Wichmann (2006)
-#
-# License Information:
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
 # This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
 
 # --- boiler-plate stuff ---
@@ -38,6 +24,4 @@
 localstatedir = @localstatedir@
 mandir = @mandir@
-datarootdir = @datarootdir@
-mytmpdir = @mytmpdir@
 
 configfile = @myconffile@
@@ -63,9 +47,6 @@
 INSTALL_DSYS = @INSTALL@ -m 755
 
-PACKAGE = @PACKAGE_NAME@
-VERSION = @PACKAGE_VERSION@
-BUILD_NUM = 1
-
-DEFAULT_MAINTAINER = Nobody Nowhere <nobody@example.com>
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
 
 VFLAG    = @mytclient@
@@ -74,7 +55,6 @@
 SAMHAIN  = @sh_main_prg@
 YULECTL  = @yulectl_prg@
-SADMIN   = @samhainadmin_prg@
 XOR_CODE = @xor_code@
-TIGER_SRC = @tiger_src@
+SH_LKM   = @sh_lkm@
 
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -83,6 +63,4 @@
 
 CC = @CC@
-BUILD_CC = @BUILD_CC@
-# DBGDEF = -pg -DSH_PROFILE=1
 DBGDEF = @mydebugdef@
 DEFS = $(DBGDEF) @DEFS@ -I. -I$(top_srcdir)/include
@@ -91,8 +69,7 @@
 LIBS_TRY = @LIBS@
 LIBS_SOCK = @sh_libsocket@
-
+LIBS_KVM = @sh_libkvm@
 CFLAGS = @CFLAGS@
-CUTEST =
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(CUTEST)
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LINK = $(CC) $(DBGDEF) -O $(LDFLAGS) -o $@
 
@@ -114,19 +91,12 @@
 
 HEADERS = samhain.h sh_unix.h sh_utils.h sh_error.h sh_error_min.h sh_files.h \
-	sh_getopt.h sh_readconf.h sh_tiger.h sh_hash.h \
-	sh_mail.h sh_mail_int.h sh_nmail.h sh_filter.h \
-	sh_mem.h sh_entropy.h sh_xfer.h sh_modules.h sh_utmp.h \
-	sh_suidchk.h sh_srp.h sh_fifo.h sh_html.h sh_tools.h \
-	sh_sig.h sh_cat.h sh_calls.h sh_extern.h sh_database.h sh_trace.h \
+	sh_getopt.h sh_readconf.h sh_tiger.h sh_hash.h sh_mail.h \
+	sh_mem.h sh_entropy.h sh_forward.h sh_modules.h sh_utmp.h \
+	sh_kern.h sh_suidchk.h sh_srp.h sh_fifo.h sh_html.h sh_tools.h \
+	sh_gpg.h sh_cat.h sh_calls.h sh_extern.h sh_database.h sh_trace.h \
 	sh_schedule.h bignum.h trustfile.h slib.h zAVLTree.h \
 	lzoconf.h minilzo.h rijndael-alg-fst.h rijndael-api-fst.h \
 	rijndael-boxes-fst.h sh_socket.h sh_ignore.h sh_prelude.h \
-	sh_mounts.h sh_userfiles.h sh_static.h sh_prelink.h \
-	sh_processcheck.h sh_portcheck.h sh_pthread.h sh_string.h \
-	sh_log_check.h sh_log_evalrule.h sh_log_correlate.h \
-	sh_log_mark.h sh_log_repeat.h sh_inotify.h sh_registry.h sh_ipvx.h \
-	sh_restrict.h sh_sub.h sh_fInotify.h sh_checksum.h \
-	sh_dbIO.h sh_dbIO_int.h sh_guid.h sh_dbCheck.h sh_dbCreate.h \
-	sh_sem.h sh_subuid.h
+	sh_mounts.h sh_userfiles.h sh_static.h sh_prelink.h
 
 
@@ -137,12 +107,11 @@
 	$(srcsrc)/sh_tiger1.c $(srcsrc)/sh_tiger2.c \
 	$(srcsrc)/sh_tiger1_64.c $(srcsrc)/sh_tiger2_64.c \
-	$(srcsrc)/sh_hash.c $(srcsrc)/sh_mail.c $(srcsrc)/sh_nmail.c \
+	$(srcsrc)/sh_hash.c $(srcsrc)/sh_mail.c \
 	$(srcsrc)/sh_mem.c $(srcsrc)/sh_entropy.c \
-	$(srcsrc)/sh_xfer_client.c $(srcsrc)/sh_xfer_server.c \
-	$(srcsrc)/sh_xfer_syslog.c $(srcsrc)/sh_modules.c \
-	$(srcsrc)/sh_utmp.c $(srcsrc)/sh_login_track.c \
+	$(srcsrc)/sh_forward.c $(srcsrc)/sh_modules.c \
+	$(srcsrc)/sh_utmp.c $(srcsrc)/sh_kern.c \
 	$(srcsrc)/sh_suidchk.c $(srcsrc)/sh_srp.c \
 	$(srcsrc)/sh_fifo.c $(srcsrc)/sh_tools.c \
-	$(srcsrc)/sh_html.c $(srcsrc)/sh_sig.c \
+	$(srcsrc)/sh_html.c $(srcsrc)/sh_gpg.c \
 	$(srcsrc)/sh_cat.c $(srcsrc)/sh_calls.c \
 	$(srcsrc)/sh_extern.c $(srcsrc)/sh_database.c \
@@ -151,5 +120,5 @@
 	$(srcsrc)/bignum.c $(srcsrc)/mkhdr.c \
 	$(srcsrc)/samhain_setpwd.c $(srcsrc)/samhain_stealth.c \
-	$(srcsrc)/encode.c \
+	$(srcsrc)/encode.c $(srcsrc)/sstrip.c \
 	$(srcsrc)/trustfile.c $(srcsrc)/exepack.c \
 	$(srcsrc)/exepack_fill.c $(srcsrc)/exepack_mkdata.c \
@@ -161,59 +130,29 @@
 	$(srcsrc)/sh_userfiles.c $(srcsrc)/sh_prelude.c \
 	$(srcsrc)/sh_prelink.c $(srcsrc)/sh_static.c \
-	$(srcsrc)/sh_portcheck.c $(srcsrc)/sh_port2proc.c\
-	$(srcsrc)/sh_processcheck.c $(srcsrc)/sh_filter.c \
-	$(srcsrc)/sh_pthread.c $(srcsrc)/sh_string.c \
-	$(srcsrc)/sh_log_parse_syslog.c $(srcsrc)/sh_log_parse_pacct.c \
-	$(srcsrc)/sh_log_parse_samba.c $(srcsrc)/sh_log_parse_generic.c \
-	$(srcsrc)/sh_log_parse_apache.c $(srcsrc)/sh_log_evalrule.c \
-	$(srcsrc)/sh_log_correlate.c $(srcsrc)/sh_log_mark.c \
-	$(srcsrc)/sh_log_check.c $(srcsrc)/dnmalloc.c \
-	$(srcsrc)/sh_inotify.c $(srcsrc)/sh_log_repeat.c \
-	$(srcsrc)/sh_audit.c $(srcsrc)/sh_registry.c \
-	$(srcsrc)/sh_ipvx.c $(srcsrc)/sh_restrict.c \
-	$(srcsrc)/sh_filetype.c $(srcsrc)/sh_sub.c $(srcsrc)/sh_fInotify.c \
-	$(srcsrc)/sh_checksum.c $(srcsrc)/sh_guid.c $(srcsrc)/sh_sem.c \
-	$(srcsrc)/sh_dbIO.c $(srcsrc)/sh_dbCheck.c  $(srcsrc)/sh_dbCreate.c \
-	$(srcsrc)/sh_subuid.c \
-	$(srcsrc)/t-test1.c 
-
-OBJECTS = sh_files.o sh_tiger0.o sh_tiger2.o sh_tiger2_64.o \
-	samhain.o sh_unix.o sh_utils.o sh_error.o \
-	sh_getopt.o sh_readconf.o sh_filter.o \
-	sh_hash.o sh_mail.o sh_nmail.o sh_mem.o sh_login_track.o \
-	sh_entropy.o sh_modules.o sh_utmp.o \
-	sh_xfer_client.o sh_xfer_server.o sh_xfer_syslog.o \
-	sh_suidchk.o sh_srp.o sh_fifo.o sh_tools.o sh_html.o sh_sig.o \
+	$(srcsrc)/sh_prelude_old.c
+
+OBJECTS = samhain.o sh_unix.o sh_utils.o sh_error.o sh_files.o \
+	sh_getopt.o sh_readconf.o sh_tiger0.o sh_tiger1.o sh_tiger2.o \
+	sh_tiger1_64.o sh_tiger2_64.o sh_hash.o sh_mail.o sh_mem.o \
+	sh_entropy.o sh_forward.o sh_modules.o sh_utmp.o sh_kern.o \
+	sh_suidchk.o sh_srp.o sh_fifo.o sh_tools.o sh_html.o sh_gpg.o \
 	sh_cat.o sh_calls.o sh_extern.o sh_database.o sh_err_log.o \
 	sh_err_console.o sh_err_syslog.o sh_schedule.o bignum.o \
 	trustfile.o rijndael-alg-fst.o rijndael-api-fst.o slib.o \
 	zAVLTree.o sh_socket.o sh_ignore.o sh_prelude.o \
-	sh_mounts.o sh_userfiles.o sh_prelink.o sh_static.o \
-	sh_processcheck.o sh_portcheck.o sh_port2proc.o \
-	sh_log_parse_syslog.o sh_log_parse_pacct.o sh_log_parse_apache.o \
-	sh_log_parse_samba.o sh_log_evalrule.o sh_log_check.o \
-	sh_log_parse_generic.o \
-	sh_log_correlate.o sh_log_mark.o sh_log_repeat.o \
-	sh_pthread.o sh_string.o sh_inotify.o dnmalloc.o \
-	sh_audit.o sh_registry.o sh_ipvx.o sh_restrict.o \
-	sh_filetype.o sh_sub.o sh_fInotify.o sh_checksum.o \
-	sh_guid.o sh_sem.o sh_dbIO.o sh_dbCheck.o sh_dbCreate.o \
-	sh_subuid.o
-
+	sh_mounts.o sh_userfiles.o sh_prelink.o sh_static.o sh_prelude_old.o
+
+KERN = kern_head.h kern_head.c
 
 TESTSUITE = test.sh testcompile.sh testhash.sh testtiger.txt \
 	testtimesrv.sh \
-	testext.sh testrc_1ext.in test_ext.c.in testrun_1d.sh \
-	testrun_1.sh testrun_1a.sh testrun_1b.sh testrun_1c.sh \
-	testrc_1 testrc_1i.dyn test1i_file.sig test1i_samhain.pub \
-	testrun_1d.sh testrun_1e.sh testrun_1f.sh \
-	testrun_1g.sh testrun_1h.sh testrun_1i.sh \
+	testext.sh testrc_1ext.in test_ext.c.in \
+	testrun_1.sh testrun_1a.sh testrun_1b.sh testrc_1 \
 	testrun_2.sh testrun_2a.sh testrun_2b.sh testrc_2.in \
-	testrun_2c.sh testrun_2d.sh testrun_2e.sh testrun_2f.sh \
-	testrun_2g.sh
+	testrun_2c.sh testrun_2d.sh
 
 DIST_COMMON =  README COPYING LICENSE samhain.jpg \
 samhainrc.linux samhainrc.solaris samhainrc.freebsd samhainrc.aix5.2.0 \
-samhainrc.netbsd yulerc.template \
+yulerc.template \
 Install.sh 
 
@@ -222,5 +161,5 @@
 stealth_template.jpg \
 config.guess config.h.in stamp-h.in config.sub configure \
-configure.ac aclocal.m4 acinclude.m4 compile install-sh missing mkinstalldirs \
+configure.ac acconfig.h aclocal.m4 install-sh missing mkinstalldirs \
 c_random.sh c_bits.sh depend.sum depend.dep stamp-hdep
 
@@ -228,5 +167,5 @@
         src include man scripts init docs sql_init test dsys
 
-PROGRAMS = $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) $(SADMIN)
+PROGRAMS = $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL)
 
 #----------------------------------------------------------
@@ -236,5 +175,5 @@
 #----------------------------------------------------------
 
-all: $(top_srcdir)/depend.sum $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL)
+all: $(top_srcdir)/depend.sum $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) @sh_lkm@ sstrip
 
 
@@ -261,6 +200,6 @@
 	touch config.h
 
-#stamp-h: $(top_srcdir)/config.h.in config.status
-#	./config.status
+stamp-h: $(top_srcdir)/config.h.in config.status
+	./config.status
 
 Makefile: $(top_srcdir)/Makefile.in config.status
@@ -281,6 +220,6 @@
 
 depend-gen: $(srcsrc)/depend-gen.c 
-	@echo "$(BUILD_CC) -I. -o depend-gen $(srcsrc)/depend-gen.c"; \
-	$(BUILD_CC) -I. -o depend-gen $(srcsrc)/depend-gen.c 2>/dev/null || \
+	@echo "$(CC) $(CFLAGS) -o depend-gen $(srcsrc)/depend-gen.c"; \
+	$(CC) $(CFLAGS) -o depend-gen $(srcsrc)/depend-gen.c 2>/dev/null || \
 	echo "failed to compile ... hope depend.dep is ok"
 
@@ -292,5 +231,5 @@
 	if test -f depend-gen; then \
 	  failfiles=""; \
-	  for ff in $(SOURCES); do \
+	  for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
 	    ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/depend.dep $$ff || \
 		failfiles="$${failfiles} $$ff"; \
@@ -322,7 +261,4 @@
 	fi;
 
-$(top_srcdir)/stamp-hdep:
-	touch $(top_srcdir)/stamp-hdep && touch $(top_srcdir)/Makefile.in
-
 $(top_srcdir)/Makefile.in: $(top_srcdir)/stamp-hdep
 	@echo "update Makefile.in ..."; \
@@ -331,5 +267,5 @@
 	if test -f depend-gen; then \
 	  failfiles=""; \
-	  for ff in $(SOURCES); do \
+	  for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
 	     ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/Makefile.in $$ff || \
 		failfiles="$${failfiles} $$ff"; \
@@ -350,5 +286,5 @@
 depend: depend-gen
 	@echo "update Makefile.in ..."; \
-	for ff in $(SOURCES); do \
+	for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
 	  ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/Makefile.in $$ff; \
 	  echo $(srcsrc) > $(top_srcdir)/stamp-dep; \
@@ -366,7 +302,7 @@
 #
 
-CLEANFILES = encode config_xor.h depend-gen \
-	internal.h sh_MK.h trustfile samhain mkhdr encode cutest \
-	yule samhain_setpwd samhain_stealth samhainrc yulectl
+CLEANFILES = encode config_xor.h depend-gen sh_ks.h sh_ks_xor.h kern_head \
+	internal.h sh_MK.h trustfile sstrip samhain mkhdr encode \
+	yule samhain_setpwd samhain_stealth samhainrc yulectl samhain_hide.ko 
 
 clean:
@@ -378,24 +314,20 @@
 #
 
-DISTCLEANFILES = Makefile samhain.spec sh_sig_checksum.h sh_gpg_fp.h \
-	init/samhain.startLinux init/samhain.startGentoo init/samhain.startSystemd \
+DISTCLEANFILES = Makefile samhain.spec sh_gpg_checksum.h sh_gpg_fp.h \
+	init/samhain.startLinux init/samhain.startGentoo \
 	init/samhain.startLSB init/samhain.startFreeBSD \
 	init/samhain.startSolaris init/samhain.startHPUX \
-	init/samhain.startIRIX init/samhain.startMACOSX \
-	deploy.sh sh_MK.h samhain-install.sh \
-	rules.deb rules.deb-light src/CuTestMain.c \
-	scripts/samhainadmin-sig.pl scripts/samhainadmin-gpg.pl \
+	init/samhain.startIRIX \
+	deploy.sh sh_MK.h samhain-install.sh sh_gpg_chksum.h sh_gpg_fp.h \
+	rules.deb rules.deb-light \
 	scripts/samhainadmin.pl scripts/check_samhain.pl \
-	scripts/samhain.ebuild scripts/samhain.ebuild-light \
-	scripts/yuleadmin.pl scripts/logrotate \
-	scripts/redhat_i386.client.spec scripts/samhain.spec hp_ux.psf 
+	scripts/samhain.ebuild scripts/samhain.ebuild-light 
 
 TESTCLEANFILES = samhain.build samhain.new yule.html \
-	test_ext test_ext.c test_ext.res testhash.tmp \
-	testrc1.signed testrc_1ext testrc_2 testrc_2.signed \
-	test_dnmalloc samhainrc yulerc
+	test_ext test_ext.c test_ext.res test_log testhash.tmp \
+	testrc1.signed testrc_1ext testrc_2 testrc_2.signed 
 
 distclean:  clean
-	-rm -f config.status config.log configure.lineno config.h config.cache stamp-dep stamp-h @install_name@rc
+	-rm -f config.status config.log configure.lineno config.h config.cache
 	@-test -z "$(TESTCLEANFILES)" || rm -f $(TESTCLEANFILES)
 	@-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
@@ -466,9 +398,4 @@
 	fi
 
-test_dnmalloc: $(srcsrc)/t-test1.c dnmalloc.o
-	$(COMPILE) $(VFLAG) -o t-test1.o -c $(srcsrc)/t-test1.c; \
-	$(LINK) t-test1.o dnmalloc.o $(LIBS_TRY)
-
-
 #----------------------------------------------------------
 #
@@ -477,5 +404,5 @@
 #----------------------------------------------------------
 
-install: install-program install-man install-data
+install: install-lkm install-program install-man install-data
 	@echo; \
 	echo "  You can use 'samhain-install.sh uninstall' for uninstalling"; \
@@ -485,5 +412,5 @@
 	echo
 
-install-light: install-program install-data
+install-light: install-lkm install-program install-data
 	@echo; \
 	echo "  You can use 'samhain-install.sh uninstall' for uninstalling"; \
@@ -493,5 +420,5 @@
 	echo
 
-purge: uninstall-program uninstall-man 
+purge: uninstall-lkm uninstall-program uninstall-man 
 	@echo "./samhain-install.sh --destdir=$(DESTDIR) --force --verbose uninstall-data"; \
 	./samhain-install.sh --destdir=$(DESTDIR) --force --verbose uninstall-data
@@ -499,5 +426,5 @@
 remove: uninstall
 
-uninstall: uninstall-program uninstall-man uninstall-data
+uninstall: uninstall-lkm uninstall-program uninstall-man uninstall-data
 	@echo; \
 	echo "  Use 'make purge' if you also want to uninstall the configuration file"; \
@@ -519,23 +446,40 @@
 #
 
-
-install-program: $(PROGRAMS) 
+# -- NEW --
+install-lkm: @sh_lkm@
+	@RVER=`uname -r`; \
+	if test "x@sh_lkm@" != "x"; then \
+	  if test -d /lib/modules/$$RVER; then \
+	    MODDIR="/lib/modules/$$RVER"; \
+	  elif test -d /lib/modules/misc; then \
+	    MODDIR="/lib/modules/misc"; \
+	  elif test -d /lib/modules; then \
+	    MODDIR="/lib/modules/misc"; \
+	  fi; \
+	  $(mkinstalldirs) $(DESTDIR)$${MODDIR}; \
+	  list='@sh_lkm@'; for p in $$list; do \
+	    echo " cp $$p $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'`"; \
+	    cp $$p $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'` ; \
+	    chown root $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'`; \
+	  done; \
+	  if test "x$(DESTDIR)" = x; then \
+	    echo " depmod -a || /sbin/depmod -a"; \
+	    depmod -a || /sbin/depmod -a; \
+	  fi; \
+	fi
+
+uninstall-lkm:
+	@echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-lkm";\
+	./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-lkm
+
+
+install-program: $(PROGRAMS) sstrip
 	@$(mkinstalldirs) $(DESTDIR)$(sbindir)
-	@if test x$(mytmpdir) != x; then \
-		$(mkinstalldirs) $(DESTDIR)$(mytmpdir); \
-	fi
 	@list='$(PROGRAMS)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    target=$(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'|sed 's%.*/%%'`; \
-	    extension=`echo $$target|sed 's%.*\.%%'`; \
-	    if test x$$extension = x; then \
-	      echo " $(INSTALL_PROGRAM) $$p $$target"; \
-	      $(INSTALL_PROGRAM) $$p $$target; \
-	      chmod 0700 $$target; \
-	    else \
-	      echo " $(INSTALL_SHELL) $$p $$target"; \
-	      $(INSTALL_SHELL) $$p $$target; \
-	      chmod 0700 $$target; \
-	    fi; \
+	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"; \
+	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
+	    echo " ./sstrip $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"; \
+	    ./sstrip $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
 	  else :; fi; \
 	done
@@ -583,10 +527,6 @@
 	@$(mkinstalldirs) $(DESTDIR)$(mylockdir)
 	@$(mkinstalldirs) $(DESTDIR)$(mylogdir)
-	@if test -d $(DESTDIR)$(mydatadir); then \
-		:; \
-	else \
-		$(mkinstalldirs) $(DESTDIR)$(mydatadir); \
-		chmod 755 $(DESTDIR)$(mydatadir); \
-	fi
+	@$(mkinstalldirs) $(DESTDIR)$(mydatadir); \
+	chmod 700 $(DESTDIR)$(mydatadir)
 	@if test -f samhainrc.$(selectconfig); then \
 		:; \
@@ -608,18 +548,4 @@
 		if test -f $(srcdir)/stealth_template.jpg; then \
 			cp $(srcdir)/stealth_template.jpg . ; \
-		fi; \
-	fi
-	@if test -d /etc/logrotate.d; then \
-		if test ! -d $(DESTDIR)/etc/logrotate.d; then \
-			$(mkinstalldirs) $(DESTDIR)/etc/logrotate.d; \
-		fi; \
-		if test ! -f $(DESTDIR)/etc/logrotate.d/@install_name@; then \
-			if test -w $(DESTDIR)/etc/logrotate.d; then \
-				cp $(srcdir)/scripts/logrotate $(DESTDIR)/etc/logrotate.d/@install_name@; \
-			else \
-				echo "$(DESTDIR)/etc/logrotate.d not writable"; \
-			fi; \
-		else \
-			echo "$(DESTDIR)/etc/logrotate.d/@install_name@ exists, not overwriting"; \
 		fi; \
 	fi
@@ -687,5 +613,5 @@
 run-light: all
 	@echo "Building $(PACKAGE)-$(VERSION).run"; \
-	STAGE=$(PACKAGE)-$(VERSION)-run-installer; \
+	STAGE=$(PACKAGE)-$(VERSION); \
 	mkdir $$STAGE; \
 	if test x"$$?" != x0; then \
@@ -693,10 +619,7 @@
 	  exit 1; \
 	fi; \
-	$(MAKE) DESTDIR=$$STAGE install-light; \
+	make DESTDIR=$$STAGE install-light; \
 	rm -f $$STAGE/@sbindir@/@install_name@_stealth; \
 	echo "#! /bin/sh"                        > $$STAGE/setup.sh; \
-	if test x$(mytmpdir) != x; then \
-	echo  "./mkinstalldirs @mytmpdir@ || exit 1"    >> $$STAGE/setup.sh; \
-	fi; \
 	echo  "./mkinstalldirs @sbindir@ || exit 1"     >> $$STAGE/setup.sh; \
 	echo  "./mkinstalldirs @sysconfdir@ || exit 1"  >> $$STAGE/setup.sh; \
@@ -705,19 +628,27 @@
 	echo  "./mkinstalldirs @mydataroot@ || exit 1"  >> $$STAGE/setup.sh; \
 	echo  "chmod 700       @mydataroot@ || exit 1"  >> $$STAGE/setup.sh; \
+	if test -f $$STAGE/lib/modules; then \
+	  RVER=`uname -r`; \
+	  echo "chown root:root lib/modules/$$RVER/*" >> $$STAGE/setup.sh; \
+	  if test -d /lib/modules/$$RVER; then \
+	    echo "./mkinstalldirs /lib/modules/$$RVER" >> $$STAGE/setup.sh; \
+	    echo  "cp -p lib/modules/$$RVER/* /lib/modules/$$RVER/" >> $$STAGE/setup.sh; \
+	  elif test -d /lib/modules/misc; then \
+	    echo "./mkinstalldirs /lib/modules/misc"   >> $$STAGE/setup.sh; \
+	    echo  "cp -p lib/modules/misc/* /lib/modules/misc/" >> $$STAGE/setup.sh; \
+	  elif test -d /lib/modules; then \
+	    echo "./mkinstalldirs /lib/modules/misc"   >> $$STAGE/setup.sh; \
+	    echo  "cp -p lib/modules/misc/* /lib/modules/misc/" >> $$STAGE/setup.sh; \
+	  fi; \
+	  echo "/sbin/depmod -a" >> $$STAGE/setup.sh; \
+	fi; \
 	temp=`echo $(sbindir) | sed s,^/,,`; \
 	echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
 	echo  "cp -p $$temp/* $(sbindir) || exit 1" >> $$STAGE/setup.sh; \
 	temp=`echo $(sysconfdir) | sed s,^/,,`; \
-	echo "chown -R root $$temp/*" >> $$STAGE/setup.sh; \
+	echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
 	configfile=`echo  @myconffile@ | sed 's%^REQ_FROM_SERVER%%'`; \
-	echo  "cp -pr $$temp/* @sysconfdir@"                           >> $$STAGE/setup.sh; \
-	echo  "./samhain-install.sh --express --verbose install-boot"  >> $$STAGE/setup.sh; \
-	echo  "if [ \$$? -ne 0 ]"                                      >> $$STAGE/setup.sh; \
-	echo  "then"                                                   >> $$STAGE/setup.sh; \
-	echo  "  echo 'Installation finished, but could not install boot-time init scripts'"      >> $$STAGE/setup.sh; \
-	echo  "  exit 2"                                               >> $$STAGE/setup.sh; \
-	echo  "fi"                                                     >> $$STAGE/setup.sh; \
-	echo  "echo 'Installation finished'"                           >> $$STAGE/setup.sh; \
-	echo  "exit 0"                                                 >> $$STAGE/setup.sh; \
+	echo  "test -f $$configfile || cp -p $$temp/* $$configfile" >> $$STAGE/setup.sh; \
+	echo  "./samhain-install.sh --express --verbose install-boot"    >> $$STAGE/setup.sh; \
 	cp $(top_srcdir)/mkinstalldirs $$STAGE/; \
 	cp $(top_srcdir)/install-sh $$STAGE/; \
@@ -729,5 +660,5 @@
 	chmod +x $$STAGE/install-sh; \
 	$(top_srcdir)/scripts/makeself/makeself.sh --header $(top_srcdir)/scripts/makeself/makeself-header.sh --nocomp --nomd5 --notemp $$STAGE $(PACKAGE)-$(VERSION).run "$(PACKAGE)_$(VERSION)_self_extracting_installer" ./setup.sh && \
-	rm -r $$STAGE
+	rm -r $(PACKAGE)-$(VERSION)
 
 emerge-prepare: dist
@@ -808,13 +739,19 @@
 	chmod +x debian/rules; \
 	echo $(sbindir)     | sed s,^/,,  > debian/dirs; \
-	if test x$(mytmpdir) != x; then \
-	echo $(mytmpdir)    | sed s,^/,, >> debian/dirs; \
-	fi; \
 	echo $(sysconfdir)  | sed s,^/,, >> debian/dirs; \
 	echo etc/init.d                  >> debian/dirs; \
-	echo lib/systemd/system          >> debian/dirs; \
 	echo $(mydatadir)   | sed s,^/,, >> debian/dirs; \
 	echo $(mylogdir)    | sed s,^/,, >> debian/dirs; \
 	echo $(mylockdir)   | sed s,^/,, >> debian/dirs; \
+	if test "x@sh_lkm@" != x; then \
+	  RVER=`uname -r`; \
+	  if test -d /lib/modules/$$RVER; then \
+	    echo "lib/modules/$$RVER"    >> debian/dirs; \
+	  elif test -d /lib/modules/misc; then \
+	    echo "lib/modules/misc"      >> debian/dirs; \
+	  elif test -d /lib/modules; then \
+	    echo "lib/modules/misc"      >> debian/dirs; \
+	  fi; \
+	fi; \
 	$(MAKE) deb-run
 
@@ -825,10 +762,6 @@
 	chmod +x debian/rules; \
 	echo $(sbindir)     | sed s,^/,,  > debian/dirs; \
-	if test x$(mytmpdir) != x; then \
-	echo $(mytmpdir)    | sed s,^/,, >> debian/dirs; \
-	fi; \
 	echo $(sysconfdir)  | sed s,^/,, >> debian/dirs; \
 	echo etc/init.d                  >> debian/dirs; \
-	echo lib/systemd/system          >> debian/dirs; \
 	echo $(mydatadir)   | sed s,^/,, >> debian/dirs; \
 	echo $(mylogdir)    | sed s,^/,, >> debian/dirs; \
@@ -837,4 +770,14 @@
 	echo $(mandir)/man8 | sed s,^/,, >> debian/dirs; \
 	echo usr/share/doc/$(PACKAGE)    >> debian/dirs; \
+	if test "x@sh_lkm@" != x; then \
+	  RVER=`uname -r`; \
+	  if test -d /lib/modules/$$RVER; then \
+	    echo "lib/modules/$$RVER"    >> debian/dirs; \
+	  elif test -d /lib/modules/misc; then \
+	    echo "lib/modules/misc"      >> debian/dirs; \
+	  elif test -d /lib/modules; then \
+	    echo "lib/modules/misc"      >> debian/dirs; \
+	  fi; \
+	fi; \
 	echo $(top_srcdir)/README                         > debian/docs; \
 	echo $(top_srcdir)/test/testtiger.txt            >> debian/docs; \
@@ -846,22 +789,20 @@
 	echo $(top_srcdir)/docs/HOWTO-client+server.html >> debian/docs; \
 	echo $(top_srcdir)/docs/HOWTO-samhain+GnuPG.html >> debian/docs; \
-	echo $(top_srcdir)/docs/MANUAL-2_4.html.tar      >> debian/docs; \
-	echo $(top_srcdir)/docs/MANUAL-2_4.pdf           >> debian/docs; \
+	echo $(top_srcdir)/docs/MANUAL-2_0.html.tar      >> debian/docs; \
+	echo $(top_srcdir)/docs/MANUAL-2_0.ps            >> debian/docs; \
 	echo $(top_srcdir)/docs/README.gcc_bug           >> debian/docs; \
 	echo $(top_srcdir)/docs/README.LZO               >> debian/docs; \
+	echo $(top_srcdir)/docs/README.sstrip            >> debian/docs; \
 	echo $(top_srcdir)/docs/README.UPGRADE           >> debian/docs; \
 	echo $(top_srcdir)/docs/README.win2K             >> debian/docs; \
+	echo $(top_srcdir)/docs/TODO                     >> debian/docs; \
 	$(MAKE) deb-run
 
 deb-run:
-	@maintainer=`gpg --list-secret-keys | grep 'uid ' | cut -d" " -f 5- | sed 's/^ *//' | sed q1`;\
+	@maintainer=`gpg --list-secret-keys | grep 'sec ' | cut -d" " -f 5-`;\
 	if test "x$$maintainer" = x; then \
-		maintainer="$(DEFAULT_MAINTAINER)"; \
-	fi; \
-	codename=`lsb_release -a 2>/dev/null | grep Codename | cut -f 2`; \
-	if test "x$$codename" = x; then \
-		codename="stable"; \
-	fi; \
-	echo "$(PACKAGE) ($(VERSION)-$(BUILD_NUM)) $$codename; urgency=low" > debian/changelog; \
+		maintainer="Nobody Nowhere <nobody@example.com>"; \
+	fi; \
+	echo "$(PACKAGE) ($(VERSION)-1) stable; urgency=low" > debian/changelog; \
 	echo >> debian/changelog; \
 	echo "  * Initial release." >> debian/changelog; \
@@ -869,7 +810,9 @@
 	echo " -- $$maintainer  `date -R`" >> debian/changelog; \
 	echo >> debian/changelog; \
+	echo "Local variables:" >> debian/changelog; \
+	echo "mode: debian-changelog" >> debian/changelog; \
+	echo "End:" >> debian/changelog; \
 	cp   $(top_srcdir)/COPYING  debian/copyright; \
-	echo "9" > debian/compat; \
-	echo "Nothing to see here." > debian/README.debian; \
+	touch debian/README.debian; \
 	echo "Document: @install_name@-manual" > debian/@install_name@.doc-base; \
 	echo "Title: @install_name@ Manual" >> debian/@install_name@.doc-base; \
@@ -878,32 +821,29 @@
 	echo " and how it can be used to check the file integrity of your" >> debian/@install_name@.doc-base; \
 	echo " server." >> debian/@install_name@.doc-base; \
-	echo "Section: System/Security" >> debian/@install_name@.doc-base; \
+	echo "Section: admin" >> debian/@install_name@.doc-base; \
 	echo  >> debian/@install_name@.doc-base; \
 	echo  >> debian/@install_name@.doc-base; \
 	echo "Format: Postscript" >> debian/@install_name@.doc-base; \
-	echo "Files: /usr/share/doc/@install_name@/manual.pdf.gz" >> debian/@install_name@.doc-base; \
+	echo "Files: /usr/share/doc/@install_name@/manual.ps.gz" >> debian/@install_name@.doc-base; \
 	echo  >> debian/@install_name@.doc-base; \
 	echo "Format: HTML" >> debian/@install_name@.doc-base; \
 	echo "Index: /usr/share/doc/@install_name@/manual.html/index.html" >> debian/@install_name@.doc-base; \
 	echo "Files: /usr/share/doc/@install_name@/manual.html/*.html" >> debian/@install_name@.doc-base; \
-	if test -f /usr/lib/lsb/install_initd; then \
-	  cp init/samhain.startLSB debian/@install_name@.init; \
-	else \
-	  cp init/samhain.startLinux debian/@install_name@.init; \
-	fi; \
+	echo $(sysconfdir)/@install_name@rc > debian/conffiles; \
+	echo /etc/init.d/@install_name@ >> debian/conffiles; \
+	cp init/samhain.startLinux debian/@install_name@.init; \
 	echo "Source: samhain"     > debian/control; \
 	echo "Section: admin"     >> debian/control; \
 	echo "Priority: optional" >> debian/control; \
 	echo "Maintainer: $$maintainer" >> debian/control; \
-	echo "Build-Depends: debhelper (>> 9)" >> debian/control; \
-	echo "Standards-Version: 3.9.8" >> debian/control; \
+	echo "Standards-Version: 3.2.1" >> debian/control; \
 	echo >> debian/control; \
 	echo "Package: @install_name@" >> debian/control; \
 	echo "Architecture: any" >> debian/control; \
-	echo "Depends: \$${shlibs:Depends}, \$${misc:Depends}" >> debian/control; \
+	echo "Depends: \$${shlibs:Depends}" >> debian/control; \
 	echo "Description: File integrity checker"  >> debian/control; \
 	echo " A file integrity checker"  >> debian/control; \
 	echo "running debuild -us -uc"; \
-	export DEB_BUILD_MAINT_OPTIONS=optimize=-all; debuild --preserve-envvar=PASSWORD -us -uc -b; \
+	debuild -us -uc; \
 	DEBFILE=`find ../ -follow -maxdepth 1 -cnewer ./debian/control 2>/dev/null | grep '@install_name@_$(VERSION)' | grep '\.deb'`; \
 	if test x"$$DEBFILE" = x; then \
@@ -912,6 +852,5 @@
 	else \
 	  echo "Package $$DEBFILE built."; \
-	  cp $$DEBFILE ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb; \
-	  ln --backup=numbered -fs ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb ./$(PACKAGE)-$(VERSION).deb; \
+	  cp $$DEBFILE ./$(PACKAGE)-$(VERSION).deb; \
 	fi; \
 	echo
@@ -933,24 +872,11 @@
 rpmspec-light: samhain.spec
 	@echo "Stripping docs from samhain.spec"; \
-	cat samhain.spec | sed 's,make DESTDIR=$${RPM_BUILD_ROOT} install,make   DESTDIR=$${RPM_BUILD_ROOT} install-light,' | sed s,shkeep=yes,shkeep=no, | sed s,%doc.*,, | sed '/logrotate/! { s,%attr.*,, }' > samhain.spec-light; \
+	cat samhain.spec | sed 's,make DESTDIR=$${RPM_BUILD_ROOT} install,make   DESTDIR=$${RPM_BUILD_ROOT} install-light,' | sed s,shkeep=yes,shkeep=no, | sed s,%doc.*,, | sed s,%attr.*,, > samhain.spec-light; \
 	mv samhain.spec-light samhain.spec
 
 rpm-light: rpmspec-light distrpm
 	rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz; 
-	@RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
-	if test x"$$RPMTOP" = x; then \
-	  try_RPMTOP=`echo $${HOME}/rpmbuild`; \
-	else \
-	  if test ! -d "$${try_RPMTOP}"; then \
-	    try_RPMTOP=`echo $${HOME}/rpmbuild`; \
-	  fi; \
-	fi; \
-	if test -d "$${try_RPMTOP}"; then \
-	  RPMTOP="$${try_RPMTOP}"; \
-	else \
-	  RPMTOP=/usr/src; \
-	fi; \
-	echo "Searching the RPM package below $$RPMTOP ..."; \
-	RPMFILE=`find $$RPMTOP -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
+	@echo "Searching the RPM package ..."; \
+	RPMFILE=`find /usr/src -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
 	echo; \
 	if test x"$$RPMFILE" = x; then \
@@ -959,5 +885,4 @@
 	else \
 	  echo "Package $$RPMFILE built."; \
-	  echo "Copying it to ./$(PACKAGE)-$(VERSION).rpm"; \
 	  cp $$RPMFILE ./$(PACKAGE)-$(VERSION).rpm; \
 	fi; \
@@ -966,19 +891,6 @@
 rpm: rpmspec-full distrpm
 	rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz; 
-	@RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
-	if test x"$$RPMTOP" = x; then \
-	  try_RPMTOP=`echo $${HOME}/rpmbuild`; \
-	else \
-	  if test ! -d "$${try_RPMTOP}"; then \
-	    try_RPMTOP=`echo $${HOME}/rpmbuild`; \
-	  fi; \
-	fi; \
-	if test -d "$${try_RPMTOP}"; then \
-	  RPMTOP="$${try_RPMTOP}"; \
-	else \
-	  RPMTOP=/usr/src; \
-	fi; \
-	echo "Searching the RPM package below $$RPMTOP ..."; \
-	RPMFILE=`find $$RPMTOP -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
+	@echo "Searching the RPM package ..."; \
+	RPMFILE=`find /usr/src -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
 	echo; \
 	if test x"$$RPMFILE" = x; then \
@@ -987,5 +899,4 @@
 	else \
 	  echo "Package $$RPMFILE built."; \
-	  echo "Copying it to ./$(PACKAGE)-$(VERSION).rpm"; \
 	  cp $$RPMFILE ./$(PACKAGE)-$(VERSION).rpm; \
 	fi; \
@@ -1011,5 +922,5 @@
 	  exit 1; \
 	fi; \
-	$(MAKE) DESTDIR=$$STAGE install-light;
+	make DESTDIR=$$STAGE install-light;
 	$(MAKE) solaris-pkg-finish
 
@@ -1021,5 +932,5 @@
 	  exit 1; \
 	fi; \
-	$(MAKE) DESTDIR=$$STAGE install; 
+	make DESTDIR=$$STAGE install; 
 	$(MAKE) solaris-pkg-finish
 
@@ -1031,21 +942,11 @@
 	user=`id | sed s,uid=[0123456789]*\(,, | sed s,\).*,,`; \
 	group=`id | sed s,.*gid=[0123456789]*\(,, | sed s,\).*,,`; \
-	cat prototype | grep -v 'none / ' | \
+	cat prototype | grep -v 'none / ' | grep -v 'none /usr ' | \
+	grep -v 'none /usr/local ' | grep -v 'none /usr/bin ' | \
+	grep -v 'none /usr/local/bin ' | grep -v 'none /usr/local/sbin ' | \
+	grep -v 'none /var ' | grep -v 'none /usr/sbin ' | \
 	sed s,$$user\ $$group,root\ sys,g > prototype.1; \
-	rm -f prototype.2; \
-	while read line; do \
-		echo "$${line}" | egrep '^d none' >/dev/null 2>&1;  \
-		if [ $$? = 0 ]; then \
-			dir=`echo "$${line}" | awk '{ print $$3 }'`; \
-			if [ -d "$$dir" ]; then \
-				echo "d none $${dir} ? ? ?" >> prototype.2; \
-			else \
-				echo "$${line}" >> prototype.2; \
-			fi; \
-		else \
-			echo "$${line}" >> prototype.2; \
-		fi; \
-	done < prototype.1; \
-	rm -f prototype && rm prototype.1 && mv prototype.2 prototype; \
+	rm -f prototype && mv prototype.1 prototype; \
+	echo "d none /var ? ? ?" >> prototype; \
 	echo "d none /etc/rc0.d ? ? ?" >> prototype; \
 	echo "d none /etc/rc1.d ? ? ?" >> prototype; \
@@ -1055,5 +956,5 @@
 	echo "l none /etc/rc1.d/K10@install_name@=/etc/init.d/@install_name@" >> prototype; \
 	ARCH=`uname -p`; \
-	PSTAMP=`date '+%c%y%m%d%H%M%S'`; \
+	PSTAMP=`date '+%cc%yy%mm%dd%HH%MM%SS'`; \
 	echo "PKG=@install_name@"         >  pkginfo; \
 	echo "NAME=file integrity check"  >> pkginfo; \
@@ -1070,18 +971,11 @@
 	  echo; \
 	  cp /tmp/samhain-pkg-staging/@install_name@.pkg $(PACKAGE)-$(VERSION).pkg; \
-	  echo "Package $(PACKAGE)-$(VERSION).pkg is ready for installation"; \
-	  echo "to install, use: pkgadd -n -d $(PACKAGE)-$(VERSION).pkg all"; \
+	  echo "Package @install_name@.pkg is ready for installation"; \
 	  echo; \
-	  rm -rf /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
+	  rm -r /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
 	else \
 	  echo; \
-	  echo "**************************************************************"; \
 	  echo "Error ... cannot find /tmp/samhain-pkg-staging/@install_name@.pkg."; \
 	  echo "Keeping /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging"; \
-	  if test -d /var/spool/pkg; then \
-		echo "**************************************************************"; \
-	  else \
-		echo "************** /var/spool/pkg is missing *********************"; \
-	  fi; \
 	  echo; \
 	  exit 1; \
@@ -1095,6 +989,6 @@
 	  exit 1; \
 	fi; \
-	$(MAKE) DESTDIR=$$STAGE install; \
-	$(MAKE) DESTDIR=$$STAGE install-boot; \
+	make DESTDIR=$$STAGE install; \
+	make DESTDIR=$$STAGE install-boot; \
 	cp hp_ux.psf $$STAGE; \
 	mkdir $$STAGE/sc; \
@@ -1137,23 +1031,29 @@
 
 
+sstrip: $(srcsrc)/sstrip.c Makefile
+	$(COMPILE)  -o sstrip $(srcsrc)/sstrip.c
+
 encode: $(srcsrc)/encode.c Makefile
-	$(BUILD_CC) -I. -o encode $(srcsrc)/encode.c
+	$(COMPILE)  -o encode $(srcsrc)/encode.c
 
 config_xor.h: config.h encode
 	@echo 'encode $(XOR_CODE) config.h'; \
+	sleep 1; \
 	./encode $(XOR_CODE) config.h; \
 	mv x_config.h  config_xor.h
 
-
-$(OBJECTS): encode internal.h config_xor.h
+#.c.o:
+#	@echo "./encode $(XOR_CODE) $<  -->  x_`echo $< |sed 's%.*/%%'`"; \
+#	./encode $(XOR_CODE) $<; \
+#	echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $< |sed 's%.*/%%'`"; \
+#	$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $< |sed 's%.*/%%'`; \
+#	rm x_`echo $< |sed 's%.*/%%'`
+
+$(OBJECTS):
 	@echo "./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c --> x_`echo $@ |sed 's%\.o$$%%'`.c"; \
 	./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c; \
 	echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c"; \
-	$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c && \
+	$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c; \
 	rm x_`echo $@ |sed 's%\.o$$%%'`.c
-
-sh_tiger_i.o: $(srcsrc)/$(TIGER_SRC) Makefile config_xor.h 
-	@echo "$(COMPILE) $(VFLAG) -o sh_tiger_i.o -c $(srcsrc)/$(TIGER_SRC)";\
-	$(COMPILE) $(VFLAG) -o sh_tiger_i.o -c $(srcsrc)/$(TIGER_SRC);
 
 samhain_setpwd: encode config_xor.h $(srcsrc)/samhain_setpwd.c
@@ -1175,54 +1075,57 @@
 	rm x_yulectl.c
 
-$(SAMHAIN): internal.h $(OBJECTS) sh_tiger_i.o
+$(SAMHAIN): internal.h $(OBJECTS)
 	@-rm -f $(SAMHAIN)
-	@echo "$(LINK) sh_tiger_i.o $(OBJECTS) $(LIBS_TRY)"; \
-	$(LINK) sh_tiger_i.o $(OBJECTS) $(LIBS_TRY)
-
-
-CUTEST_SOURCES = $(srcsrc)/cutest_sh_tools.c \
-		$(srcsrc)/cutest_sh_utils.c \
-		$(srcsrc)/cutest_sh_unix.c \
-		$(srcsrc)/cutest_slib.c \
-		$(srcsrc)/cutest_zAVLTree.c \
-		$(srcsrc)/cutest_sh_hash.c \
-		$(srcsrc)/cutest_sh_tiger0.c
-
-CUTEST_OBJECTS = cutest_sh_tools.o \
-	cutest_sh_utils.o \
-	cutest_sh_unix.o \
-	cutest_slib.o \
-	cutest_zAVLTree.o \
-	cutest_sh_hash.o \
-	cutest_sh_tiger0.o
-
-$(CUTEST_OBJECTS): $(CUTEST_SOURCES) config_xor.h internal.h
-	@echo "./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c --> x_`echo $@ |sed 's%\.o$$%%'`.c"; \
-	./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c; \
-	echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c"; \
-	$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c; \
-	rm x_`echo $@ |sed 's%\.o$$%%'`.c
-
-
-cutest: $(SOURCES) $(CUTEST_SOURCES)
-	@$(MAKE) CUTEST='-DSH_CUTEST=1' intcutest
-
-$(srcsrc)/CuTestMain.c: $(SOURCES) $(CUTEST_SOURCES) $(srcsrc)/make-tests.sh
-	cd $(srcsrc)/ && ./make-tests.sh >CuTestMain.c;
-
-intcutest: internal.h $(OBJECTS) $(CUTEST_OBJECTS) sh_tiger_i.o $(srcsrc)/CuTestMain.c
-	@$(COMPILE) -o CuTestMain.o -c $(srcsrc)/CuTestMain.c; \
-	$(COMPILE) -o CuTest.o -c $(srcsrc)/CuTest.c; \
-	rm -f samhain.o; \
-	./encode $(XOR_CODE) $(srcsrc)/samhain.c; \
-	$(COMPILE) $(VFLAG) -o samhain.o -c x_samhain.c; \
-	rm x_samhain.c; \
-	$(LINK) sh_tiger_i.o $(CUTEST_OBJECTS) CuTestMain.o CuTest.o $(OBJECTS) $(LIBS_TRY); \
-	test -f ./intcutest && mv ./intcutest ./cutest; \
-	./cutest
-
-runcutest:
-	gdb ./cutest
-
+	@echo "$(LINK) $(OBJECTS) $(LIBS_TRY)"; \
+	$(LINK) $(OBJECTS) $(LIBS_TRY)
+
+
+
+samhain_hide.o: $(srcsrc)/samhain_hide.c samhain_erase.o
+	gcc @lkm_inc@ -I. -Wall -O2  -c $(srcsrc)/samhain_hide.c
+
+samhain_erase.o: $(srcsrc)/samhain_erase.c
+	gcc @lkm_inc@ -I. -Wall -O2  -c $(srcsrc)/samhain_erase.c
+
+# -- NEW --
+samhain_hide.ko: $(srcsrc)/samhain_hide.c
+	@test -d m_comp || mkdir m_comp; \
+	echo "KVERSION := \$$(shell uname -r)" > m_comp/Makefile;\
+	echo "KSOURCE ?= /lib/modules/\$$(KVERSION)/build" >> m_comp/Makefile;\
+	echo "obj-m   := samhain_hide.o"                   >> m_comp/Makefile;\
+	echo ".PHONY: modules install clean modules_add"   >> m_comp/Makefile;\
+	echo "install : modules_add"                       >> m_comp/Makefile;\
+	echo "modules modules_install clean:"              >> m_comp/Makefile;\
+	echo "T\$$(MAKE) -C \$$(KSOURCE) \$$@ SUBDIRS=\$$(CURDIR) KBUILD_VERBOSE=2" |  tr T '\t' >> m_comp/Makefile;\
+	cp config.h m_comp/; \
+	cp $(srcsrc)/samhain_hide.c m_comp/; \
+	cd m_comp && make modules
+	@if test -f m_comp/samhain_hide.ko; then \
+	  cp -p m_comp/samhain_hide.ko samhain_hide.ko; \
+	  rm -rf m_comp/; \
+	else \
+	  echo "Kernel module samhain_hide.ko not build"; \
+	  exit 1; \
+	fi
+
+# -- NEW --
+lkm: @sh_lkm@
+
+
+
+# For kernel syscall monitoring
+kern_head: Makefile $(top_srcdir)/include/kern_head.h $(srcsrc)/kern_head.c
+	@echo "$(COMPILE) -DSYSTEMMAP=\"@systemmap@\" -o kern_head $(srcsrc)/kern_head.c $(LIBS_KVM)"; \
+	$(COMPILE) -DSYSTEMMAP=\"@systemmap@\" -o kern_head $(srcsrc)/kern_head.c $(LIBS_KVM)
+
+sh_ks.h: kern_head
+	@sleep 1; \
+	./kern_head > sh_ks.h
+
+sh_ks_xor.h: encode sh_ks.h
+	@echo 'encode $(XOR_CODE) sh_ks.h'; \
+	sleep 1; \
+	./encode $(XOR_CODE) sh_ks.h; \
+	mv x_sh_ks.h  sh_ks_xor.h
 
 # For bignum
@@ -1233,12 +1136,11 @@
 bignum.o: internal.h
 
-
 # If your compiler can't handle long identifiers (> 6 chars), move the `#' to
 # the other line.
 
 mkhdr: $(srcsrc)/mkhdr.c config.h 
-	@echo "$(BUILD_CC) -I. -o mkhdr $(srcsrc)/mkhdr.c"; \
+	@echo "$(COMPILE)  -o mkhdr $(srcsrc)/mkhdr.c"; \
 	sleep 1; \
-	$(BUILD_CC) -I. -o mkhdr $(srcsrc)/mkhdr.c
+	$(COMPILE)  -o mkhdr $(srcsrc)/mkhdr.c
 
 #	$(COMPILE)  -DBIG_SHORT_NAMES -o mkhdr $(srcdir)/mkhdr.c
@@ -1263,9 +1165,11 @@
 # prepare the data to be packed
 #
-exepack.data: $(SAMHAIN) exepack_mkdata 
+exepack.data: $(SAMHAIN) exepack_mkdata sstrip
 	@echo "cp ./$(SAMHAIN) ./samhain.pk.data"; \
 	cp ./$(SAMHAIN) ./samhain.pk.data; \
 	echo "strip ./samhain.pk.data"; \
 	strip ./samhain.pk.data > /dev/null 2>&1  || echo "... is already stripped"; \
+	echo "./sstrip ./samhain.pk.data"; \
+	./sstrip ./samhain.pk.data > /dev/null 2>&1  || echo "sstrip returned false"; \
 	echo "./exepack_mkdata ./samhain.pk.data ./exepack.data 0"; \
 	./exepack_mkdata ./samhain.pk.data ./exepack.data 0; \
@@ -1288,9 +1192,11 @@
 	$(LINK) exepack_fill.o minilzo.o
 
-samhain.pk: $(SAMHAIN) exepack exepack_fill 
+samhain.pk: $(SAMHAIN) exepack exepack_fill sstrip
 	@echo "cp ./$(SAMHAIN) ./samhain.pk.data"; \
 	cp ./$(SAMHAIN) ./samhain.pk.data; \
 	echo "strip ./samhain.pk.data"; \
 	strip ./samhain.pk.data > /dev/null 2>&1  || echo "... is already stripped"; \
+	echo "./sstrip ./samhain.pk.data"; \
+	./sstrip ./samhain.pk.data > /dev/null 2>&1  || echo "sstrip returned false"; \
 	test -f exepack.out && rm exepack.out; \
 	echo "./exepack_fill exepack samhain.pk.data exepack.out"; \
@@ -1299,4 +1205,5 @@
 	echo "strip exepack.out"; \
 	strip exepack.out > /dev/null 2>&1 || echo "... is already stripped"; \
+	./sstrip exepack.out > /dev/null 2>&1 || echo "sstrip returned false"; \
 	echo "mv exepack.out samhain.pk"; \
 	rm -f samhain.pk; mv exepack.out samhain.pk
@@ -1494,18 +1401,13 @@
 	-rm -rf $(distdir)
 	-rm -f $(distdir).tar.gz.asc
-	gpg -a --detach-sign $(distdir).tar.gz; 
-	$(TAR) chof $(distdir).tar $(distdir).tar.gz $(distdir).tar.gz.asc; 
-	@if test x"$$?" != x0; then \
-		rm -f $(distdir).tar.gz; \
-		echo "ERROR creating $(PACKAGE)_signed-$(VERSION).tar.gz"; \
-	else \
-		rm -f $(distdir).tar.gz; \
-		rm -f $(distdir).tar.gz.asc; \
-		gzip --best $(distdir).tar; \
-		mv $(distdir).tar.gz $(PACKAGE)_signed-$(VERSION).tar.gz; \
-		echo "========================"; \
-		echo "$(PACKAGE)_signed-$(VERSION).tar.gz is ready for distribution"; \
-		echo "========================"; \
-	fi; \
+	@gpg -a --detach-sign $(distdir).tar.gz; \
+	$(TAR) chof $(distdir).tar $(distdir).tar.gz $(distdir).tar.gz.asc; \
+	rm -f $(distdir).tar.gz; \
+	rm -f $(distdir).tar.gz.asc; \
+	gzip --best $(distdir).tar
+	mv $(distdir).tar.gz $(PACKAGE)_signed-$(VERSION).tar.gz
+	@echo "========================"; \
+	echo "$(PACKAGE)_signed-$(VERSION).tar.gz is ready for distribution"; \
+	echo "========================"
 
 #
@@ -1561,14 +1463,10 @@
 #
 INITFILES=samhain.startIRIX samhain.startFreeBSD samhain.startSolaris \
-samhain.startLSB samhain.startGentoo samhain.startLinux samhain.startHPUX \
-samhain.startIRIX samhain.startMACOSX
-
-SCRIPTFILES=redhat_i386.client.spec check_samhain.pl samhainadmin.pl \
-samhainadmin-gpg.pl samhainadmin-sig.pl \
-yuleadmin.pl samhain.ebuild samhain.ebuild-light samhain.spec
+samhain.startLSB samhain.startGentoo samhain.startLinux samhain.startHPUX
+
+SCRIPTFILES=redhat_i386.client.spec check_samhain.pl samhainadmin.pl 
 
 distdir: distfilecheck
 	-rm -f $(top_srcdir)/init/*~
-	-rm -f $(top_srcdir)/sql_init/*~
 	-rm -f $(top_srcdir)/dsys/*~
 	-rm -f $(top_srcdir)/docs/*~
@@ -1578,9 +1476,8 @@
 	-rm -f $(top_srcdir)/scripts/*~
 	(cd $(top_srcdir)/init && rm -f $(INITFILES))
+	(cd $(top_srcdir)/scripts && rm -f $(SCRIPTFILES))
 	-rm -rf $(distdir)
 	mkdir $(distdir)
 	-chmod 777 $(distdir)
-	cp scripts/samhain.spec $(distdir)/samhain.spec; \
-	(cd $(top_srcdir)/scripts && rm -f $(SCRIPTFILES))
 	@for file in $(DISTFILES); do \
 	  d=$(top_srcdir); \
@@ -1589,4 +1486,5 @@
 	  fi; \
 	done; \
+	cp scripts/samhain.spec $(distdir)/samhain.spec; \
 	rm -f $(distdir)/scripts/*.spec
 
@@ -1639,42 +1537,38 @@
 
 
-
-samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_restrict.h $(srcinc)/sh_nmail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_sig.h $(srcinc)/sh_mem.h $(srcinc)/sh_xfer.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_sem.h sh_MK.h $(srcinc)/sh_schedule.h 
-sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_sem.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_subuid.h $(srcinc)/sh_ignore.h 
-sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h $(srcinc)/sh_pthread.h 
-sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_nmail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h $(srcinc)/sh_checksum.h 
-sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_inotify.h $(srcinc)/zAVLTree.h $(srcinc)/sh_dbIO.h $(srcinc)/CuTest.h 
-sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbCheck.h $(srcinc)/sh_dbCreate.h $(srcinc)/sh_sem.h $(srcinc)/sh_extern.h 
-sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_xfer.h $(srcinc)/sh_sig.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_ignore.h $(srcinc)/sh_database.h $(srcinc)/sh_mail.h $(srcinc)/sh_modules.h $(srcinc)/sh_nmail.h $(srcinc)/sh_prelink.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tiger.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h $(srcinc)/sh_socket.h 
-sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_checksum.h 
+samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_forward.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h sh_MK.h $(srcinc)/sh_schedule.h 
+sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/sh_ignore.h 
+sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h 
+sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h 
+sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/zAVLTree.h 
+sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h 
+sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_database.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_files.h $(srcinc)/sh_mail.h $(srcinc)/sh_calls.h $(srcinc)/sh_tiger.h $(srcinc)/sh_forward.h $(srcinc)/sh_modules.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_extern.h $(srcinc)/sh_database.h $(srcinc)/sh_prelude.h 
+sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 
 sh_tiger1.o: $(srcsrc)/sh_tiger1.c Makefile config_xor.h 
 sh_tiger2.o: $(srcsrc)/sh_tiger2.c Makefile config_xor.h 
 sh_tiger1_64.o: $(srcsrc)/sh_tiger1_64.c Makefile config_xor.h 
 sh_tiger2_64.o: $(srcsrc)/sh_tiger2_64.c Makefile config_xor.h 
-sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_hash.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_sig.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_pthread.h $(srcinc)/sh_xfer.h $(srcinc)/sh_hash.h $(srcinc)/sh_checksum.h 
-sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_pthread.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/sh_nmail.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h 
-sh_nmail.o: $(srcsrc)/sh_nmail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_string.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/zAVLTree.h 
-sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_pthread.h 
-sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h 
-sh_xfer_client.o: $(srcsrc)/sh_xfer_client.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_xfer.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h 
-sh_xfer_server.o: $(srcsrc)/sh_xfer_server.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_xfer.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/sh_guid.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h 
-sh_xfer_syslog.o: $(srcsrc)/sh_xfer_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h 
-sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_portcheck.h $(srcinc)/sh_logmon.h $(srcinc)/sh_registry.h $(srcinc)/sh_fInotify.h 
-sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h 
-sh_login_track.o: $(srcsrc)/sh_login_track.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_string.h $(srcinc)/sh_tools.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_error_min.h $(srcinc)/CuTest.h $(srcinc)/CuTest.h 
-sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h $(srcinc)/zAVLTree.h 
-sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h $(srcinc)/CuTest.h 
-sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_fifo.h $(srcinc)/CuTest.h 
-sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h 
-sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_xfer.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h 
-sh_sig.o: $(srcsrc)/sh_sig.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_sig.h 
+sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/sh_hash.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h 
+sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h 
+sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h 
+sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h 
+sh_forward.o: $(srcsrc)/sh_forward.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_forward.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_mail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h 
+sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_kern.h $(srcinc)/sh_suidchk.h 
+sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h 
+sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h 
+sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h 
+sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h 
+sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h 
+sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h 
+sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_forward.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h 
+sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h 
 sh_cat.o: $(srcsrc)/sh_cat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_cat.h 
-sh_calls.o: $(srcsrc)/sh_calls.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_sub.h $(srcinc)/sh_utils.h 
-sh_extern.o: $(srcsrc)/sh_extern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_filter.h $(srcinc)/sh_static.h 
+sh_calls.o: $(srcsrc)/sh_calls.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_calls.h 
+sh_extern.o: $(srcsrc)/sh_extern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h 
 sh_database.o: $(srcsrc)/sh_database.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 
 sh_err_log.o: $(srcsrc)/sh_err_log.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h 
-sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_sem.h 
+sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 
 sh_err_syslog.o: $(srcsrc)/sh_err_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h 
-sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_schedule.h 
+sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/sh_mem.h $(srcinc)/sh_schedule.h 
 bignum.o: $(srcsrc)/bignum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/bignum.h 
 mkhdr.o: $(srcsrc)/mkhdr.c Makefile config.h 
@@ -1682,52 +1576,22 @@
 samhain_stealth.o: $(srcsrc)/samhain_stealth.c Makefile config_xor.h 
 encode.o: $(srcsrc)/encode.c Makefile 
-trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 
+sstrip.o: $(srcsrc)/sstrip.c Makefile 
+trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h 
 exepack.o: $(srcsrc)/exepack.c Makefile config.h $(srcinc)/minilzo.h $(srcinc)/exepack.data 
 exepack_fill.o: $(srcsrc)/exepack_fill.c Makefile config.h config.h $(srcinc)/minilzo.h 
 exepack_mkdata.o: $(srcsrc)/exepack_mkdata.c Makefile config.h $(srcinc)/minilzo.h 
 minilzo.o: $(srcsrc)/minilzo.c Makefile $(srcinc)/minilzo.h 
-slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h 
-rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h 
-rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-api-fst.h 
+slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h 
+rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-boxes-fst.h 
+rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-api-fst.h 
 zAVLTree.o: $(srcsrc)/zAVLTree.c Makefile $(srcinc)/zAVLTree.h 
-sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_guid.h $(srcinc)/sh_fifo.h $(srcinc)/sh_utils.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h $(srcinc)/CuTest.h 
-sh_ignore.o: $(srcsrc)/sh_ignore.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/CuTest.h 
+sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h 
+sh_ignore.o: $(srcsrc)/sh_ignore.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h 
 yulectl.o: $(srcsrc)/yulectl.c Makefile config_xor.h 
 sh_mounts.o: $(srcsrc)/sh_mounts.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_mounts.h 
-sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 
-sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h 
+sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h 
+sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h 
+kern_head.o: $(srcsrc)/kern_head.c Makefile config.h $(srcinc)/kern_head.h $(srcinc)/kern_head.h 
 sh_prelink.o: $(srcsrc)/sh_prelink.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h 
-sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h $(srcinc)/sh_pthread.h 
-sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/CuTest.h 
-sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error_min.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h 
-sh_processcheck.o: $(srcsrc)/sh_processcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h 
-sh_filter.o: $(srcsrc)/sh_filter.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_filter.h 
-sh_pthread.o: $(srcsrc)/sh_pthread.c Makefile config_xor.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_modules.h 
-sh_string.o: $(srcsrc)/sh_string.c Makefile config_xor.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h $(srcinc)/CuTest.h 
-sh_log_parse_syslog.o: $(srcsrc)/sh_log_parse_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
-sh_log_parse_pacct.o: $(srcsrc)/sh_log_parse_pacct.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
-sh_log_parse_samba.o: $(srcsrc)/sh_log_parse_samba.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_string.h 
-sh_log_parse_generic.o: $(srcsrc)/sh_log_parse_generic.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_log_check.h $(srcinc)/sh_string.h 
-sh_log_parse_apache.o: $(srcsrc)/sh_log_parse_apache.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
-sh_log_evalrule.o: $(srcsrc)/sh_log_evalrule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/sh_log_correlate.h $(srcinc)/sh_log_mark.h $(srcinc)/sh_log_repeat.h $(srcinc)/zAVLTree.h 
-sh_log_correlate.o: $(srcsrc)/sh_log_correlate.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h 
-sh_log_mark.o: $(srcsrc)/sh_log_mark.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h $(srcinc)/sh_string.h $(srcinc)/sh_error_min.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/zAVLTree.h 
-sh_log_check.o: $(srcsrc)/sh_log_check.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/sh_log_correlate.h $(srcinc)/sh_log_mark.h $(srcinc)/sh_log_repeat.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h 
-dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h 
-sh_inotify.o: $(srcsrc)/sh_inotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/slib.h $(srcinc)/zAVLTree.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/CuTest.h 
-sh_log_repeat.o: $(srcsrc)/sh_log_repeat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h 
-sh_audit.o: $(srcsrc)/sh_audit.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_utils.h 
-sh_registry.o: $(srcsrc)/sh_registry.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_modules.h $(srcinc)/sh_hash.h $(srcinc)/sh_tiger.h 
-sh_ipvx.o: $(srcsrc)/sh_ipvx.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h $(srcinc)/CuTest.h 
-sh_restrict.o: $(srcsrc)/sh_restrict.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_string.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h $(srcinc)/CuTest.h 
-sh_filetype.o: $(srcsrc)/sh_filetype.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_utils.h 
-sh_sub.o: $(srcsrc)/sh_sub.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h 
-sh_fInotify.o: $(srcsrc)/sh_fInotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h 
-sh_checksum.o: $(srcsrc)/sh_checksum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_checksum.h $(srcinc)/sh_utils.h $(srcinc)/CuTest.h 
-sh_guid.o: $(srcsrc)/sh_guid.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/CuTest.h 
-sh_sem.o: $(srcsrc)/sh_sem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_sem.h $(srcinc)/sh_error_min.h 
-sh_dbIO.o: $(srcsrc)/sh_dbIO.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_sig.h $(srcinc)/sh_tiger.h $(srcinc)/sh_xfer.h $(srcinc)/sh_pthread.h $(srcinc)/sh_socket.h $(srcinc)/sh_files.h $(srcinc)/zAVLTree.h 
-sh_dbCheck.o: $(srcsrc)/sh_dbCheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_pthread.h 
-sh_dbCreate.o: $(srcsrc)/sh_dbCreate.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_pthread.h $(srcinc)/sh_guid.h 
-sh_subuid.o: $(srcsrc)/sh_subuid.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_unix.h 
-t-test1.o: $(srcsrc)/t-test1.c Makefile config.h $(srcinc)/malloc.h 
+sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h 
+sh_prelude_old.o: $(srcsrc)/sh_prelude_old.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_mem.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h 
