Index: /trunk/Makefile.in
===================================================================
--- /trunk/Makefile.in	(revision 161)
+++ /trunk/Makefile.in	(revision 162)
@@ -1696,4 +1696,4 @@
 sh_async.o: $(srcsrc)/sh_async.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.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_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_pthread.h $(srcinc)/CuTest.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)/CuTest.h 
 sh_pthread.o: $(srcsrc)/sh_pthread.c Makefile config_xor.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_modules.h 
Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac	(revision 161)
+++ /trunk/configure.ac	(revision 162)
@@ -13,5 +13,5 @@
 dnl start
 dnl
-AM_INIT_AUTOMAKE(samhain, 2.4.2) 
+AM_INIT_AUTOMAKE(samhain, 2.4.3) 
 AC_CANONICAL_HOST
 
@@ -207,5 +207,5 @@
 	sys/select.h sys/socket.h netinet/in.h \
 	regex.h glob.h \
-	linux/ext2_fs.h linux/fs.h ext2fs/ext2_fs.h \
+	linux/ext2_fs.h linux/fs.h ext2fs/ext2_fs.h asm/segment.h \
 	elf.h linux/elf.h \
 	paths.h arpa/nameser.h arpa/nameser_compat.h \
@@ -1751,18 +1751,21 @@
 	   if test x"$kernel_version" = xLINUX26
 	   then
-
+		AC_MSG_CHECKING([for modlist_lock])
 		sh_modlist_lock=`egrep ['[bd] modlist_lock$'] ${khidemap} | awk '{print $1}'` 
 		if test x"$sh_modlist_lock" = x; then
-			echo "--enable-khide: symbol modlist_lock not found in ${khidemap}"
+			AC_MSG_RESULT(no)
 		else
 			sh_modlist_lock="0x${sh_modlist_lock}"
+			AC_MSG_RESULT([${sh_modlist_lock}])
 			AC_DEFINE_UNQUOTED(SH_MODLIST_LOCK, ${sh_modlist_lock}, [The address of the modules list spinlock])
 		fi
-				    
+
+		AC_MSG_CHECKING([for module_mutex])		    
 		sh_modlist_mutex=`egrep ['[bd] module_mutex$'] ${khidemap} | awk '{print $1}'` 
 		if test x"$sh_modlist_mutex" = x; then
-			echo "--enable-khide: symbol module_mutex not found in ${khidemap}"
+			AC_MSG_RESULT(no)
 		else
 			sh_modlist_mutex="0x${sh_modlist_mutex}"
+			AC_MSG_RESULT([${sh_modlist_mutex}])
 			AC_DEFINE_UNQUOTED(SH_MODLIST_MUTEX, ${sh_modlist_mutex}, [The address of the modules list mutex])
 		fi
@@ -1792,4 +1795,6 @@
 		AC_MSG_WARN([--enable-khide: headers for the currently-running kernel.])
 	   fi
+
+	   AC_MSG_CHECKING([for 2.4 vanilla kernel])
 	   sh_is_vanilla_kernel=yes
 	   if test -f /lib/modules/${kvers}/build/include/linux/sched.h; then
@@ -1797,8 +1802,10 @@
 	   fi
 	   if test x"${sh_is_vanilla_kernel}" = xno; then
-		echo "This is not a 2.4 vanilla kernel"
+		AC_MSG_RESULT(no)
 	   else
+		AC_MSG_RESULT(yes)
 		AC_DEFINE(SH_VANILLA_KERNEL)
 	   fi
+
 	fi
 	]
Index: /trunk/depend.dep
===================================================================
--- /trunk/depend.dep	(revision 161)
+++ /trunk/depend.dep	(revision 162)
@@ -58,5 +58,5 @@
 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_pthread.h $(srcinc)/CuTest.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)/CuTest.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_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 $(srcinc)/sh_pthread.h 
Index: /trunk/depend.sum
===================================================================
--- /trunk/depend.sum	(revision 161)
+++ /trunk/depend.sum	(revision 162)
@@ -1,1 +1,1 @@
-1156805991
+2613935365
Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 161)
+++ /trunk/docs/Changelog	(revision 162)
@@ -1,7 +1,14 @@
 2.4.3:
+	* sh_kern.c: don't require asm/segment.h for kernel check module
+	* use global var with pid of initial thread instead of getpid(),
+	  since LinuxThreads returns different value in each thread (problem
+	  reported by Steffen Mueller)
+	* sh_kern.c: no inode check for pci rom (creates spurious messages)
+	* slib.c: eliminate prototype for vsnprintf (compile problem reported
+	  by eddy_cs)
 	* Makefile.in: fix missing dependency on 'encode' for $(OBJECTS)
 	  (reported by Matthias Ehrmann)
 
-2.4.2:
+2.4.2 (17-01-2008):
 	* fix broken option --with-checksum (reported by halosfan),
 	  regression test added
Index: /trunk/include/samhain.h
===================================================================
--- /trunk/include/samhain.h	(revision 161)
+++ /trunk/include/samhain.h	(revision 162)
@@ -249,4 +249,6 @@
 
   char   prg_name[8];
+
+  UINT64 pid;  
  
   sh_sh_df     exec;
Index: /trunk/src/samhain.c
===================================================================
--- /trunk/src/samhain.c	(revision 161)
+++ /trunk/src/samhain.c	(revision 162)
@@ -362,4 +362,6 @@
   sh.prg_name[7] = '\0';
 #endif
+
+  sh.pid = (UINT64) getpid();
 
   /* The flags.
Index: /trunk/src/sh_hash.c
===================================================================
--- /trunk/src/sh_hash.c	(revision 161)
+++ /trunk/src/sh_hash.c	(revision 162)
@@ -1206,5 +1206,7 @@
 	  {
 	    dlog(1, FIL__, __LINE__, 
-		 _("The checksum of the file signature database has changed since startup.\n"));
+		 _("The checksum of the file signature database has changed since startup: %s -> %s\n"),
+		 sh.data.hash, sh_tiger_hash (file_path('D', 'R'), fd, TIGER_NOLIM, 
+					   hashbuf, sizeof(hashbuf)));
 	    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_AUTH,
 			     ( (NULL == file_path('D', 'R')) ? _("(null)") :
Index: /trunk/src/sh_kern.c
===================================================================
--- /trunk/src/sh_kern.c	(revision 161)
+++ /trunk/src/sh_kern.c	(revision 162)
@@ -266,6 +266,7 @@
  * Interrupt Descriptor Table
  */
-
+#ifdef HAVE_ASM_SEGMENT_H
 #include <asm/segment.h>
+#endif
 
 #define SH_MAXIDT   256
@@ -276,12 +277,20 @@
 {
   switch (segment) {
+#ifdef __KERNEL_CS
   case __KERNEL_CS:
     return _("KERNEL_CS");
+#endif
+#ifdef __KERNEL_DS
   case __KERNEL_DS:
     return _("KERNEL_DS");
+#endif
+#ifdef __USER_CS
   case __USER_CS:
     return _("USER_CS");
+#endif
+#ifdef __USER_DS
   case __USER_DS:
     return _("USER_DS");
+#endif
   default:
     return _("unknown");
@@ -903,5 +912,5 @@
   (void) sl_strlcpy (theFile.fullpath, pcipath, PATH_MAX);
   theFile.check_mask  = sh_files_maskof(SH_LEVEL_READONLY);
-  theFile.check_mask &= ~(MODI_MTM|MODI_CTM);
+  theFile.check_mask &= ~(MODI_MTM|MODI_CTM|MODI_INO);
   CLEAR_SH_FFLAG_REPORTED(theFile.file_reported);
   theFile.attr_string = NULL;
@@ -938,4 +947,5 @@
   struct stat buf;
   int         fd;
+  int         status;
 
   if (0 == stat(pcipath, &buf))
@@ -945,5 +955,7 @@
        */
       fd = open ( pcipath, O_RDWR );
-      write( fd, "1", 1 );
+      do {
+	status = write( fd, "1", 1 );
+      } while (status < 0 && errno == EINTR);
       close ( fd );
 
@@ -951,5 +963,7 @@
 
       fd = open ( pcipath, O_RDWR );
-      write( fd, "0", 1 );
+      do {
+	status = write( fd, "0", 1 );
+      } while (status < 0 && errno == EINTR);
       close ( fd );
     }
Index: /trunk/src/sh_portcheck.c
===================================================================
--- /trunk/src/sh_portcheck.c	(revision 161)
+++ /trunk/src/sh_portcheck.c	(revision 162)
@@ -129,4 +129,5 @@
 #include "sh_utils.h"
 #include "sh_modules.h"
+#include "sh_static.h"
 #include "sh_pthread.h"
 
@@ -897,5 +898,5 @@
 	    
   SH_MUTEX_LOCK(mutex_resolv);
-  hent = gethostbyname(portchk_hostname);
+  hent = sh_gethostbyname(portchk_hostname);
 
   while (hent && hent->h_addr_list[i] && (iface_list.used < SH_IFACE_MAX))
Index: /trunk/src/sh_unix.c
===================================================================
--- /trunk/src/sh_unix.c	(revision 161)
+++ /trunk/src/sh_unix.c	(revision 162)
@@ -1866,4 +1866,5 @@
 
     setsid();            /* should not fail         */
+    sh.pid = (UINT64) getpid();
 
     switch (aud_fork(FIL__, __LINE__)) {
@@ -1876,4 +1877,5 @@
      */
     sh_unix_memlock();
+    sh.pid = (UINT64) getpid();
 
   } else {
@@ -3844,5 +3846,5 @@
       sl_close(fd);
 
-      if (status == (int) getpid())
+      if (status > 0 && (unsigned int) status == sh.pid)
 	{
 	  if (filename != NULL)
@@ -4007,5 +4009,5 @@
   SL_ENTER(_("sh_unix_lock"));
 
-  sprintf (myPid, "%ld\n", (long) getpid());           /* known to fit  */
+  sprintf (myPid, "%ld\n", (long) sh.pid);             /* known to fit  */
 
   fd = sl_open_safe_rdwr (lockfile, SL_YESPRIV);       /* fails if file exists */
Index: /trunk/src/slib.c
===================================================================
--- /trunk/src/slib.c	(revision 161)
+++ /trunk/src/slib.c	(revision 162)
@@ -577,11 +577,4 @@
 }
 
-#if !defined(HOST_IS_I86SOLARIS)
-#if !defined (_GNU_SOURCE) && !defined(__linux__)
-/* flawfinder: ignore */
-extern int vsnprintf ( char *str, size_t n,
-		       const char *format, va_list ap );
-#endif
-#endif
 
 #if !defined (VA_COPY)
Index: /trunk/test/testhash.sh
===================================================================
--- /trunk/test/testhash.sh	(revision 161)
+++ /trunk/test/testhash.sh	(revision 162)
@@ -37,5 +37,5 @@
 	fi
 	#
-	${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file
+	${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file 
 	#
 	fail=0
