Index: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in	(revision 39)
+++ trunk/Makefile.in	(revision 40)
@@ -484,4 +484,5 @@
 	    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@%'`; \
+	    chmod 0700 $(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@%'`; \
@@ -623,5 +624,5 @@
 	  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; \
@@ -926,5 +927,5 @@
 	  exit 1; \
 	fi; \
-	make DESTDIR=$$STAGE install-light;
+	$(MAKE) DESTDIR=$$STAGE install-light;
 	$(MAKE) solaris-pkg-finish
 
@@ -936,5 +937,5 @@
 	  exit 1; \
 	fi; \
-	make DESTDIR=$$STAGE install; 
+	$(MAKE) DESTDIR=$$STAGE install; 
 	$(MAKE) solaris-pkg-finish
 
@@ -946,11 +947,46 @@
 	user=`id | sed s,uid=[0123456789]*\(,, | sed s,\).*,,`; \
 	group=`id | sed s,.*gid=[0123456789]*\(,, | sed s,\).*,,`; \
-	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 ' | \
+	cat prototype | grep -v 'none / ' | \
+	sed 's,none /etc .*,none /etc ? ? ?,' | \
+	sed 's,none /etc/init.d .*,none /etc/init.d ? ? ?,' | \
+	sed 's,none /usr .*,none /usr ? ? ?,' | \
+	sed 's,none /usr/bin .*,none /usr/bin ? ? ?,' | \
+	sed 's,none /var .*,none /var ? ? ?,' | \
+	sed 's,none /var/lib .*,none /var/lib ? ? ?,' | \
+	sed 's,none /var/log .*,none /var/log ? ? ?,' | \
+	sed 's,none /var/run .*,none /var/run ? ? ?,' | \
+	sed 's,none /usr/sbin .*,none /usr/sbin ? ? ?,' | \
 	sed s,$$user\ $$group,root\ sys,g > prototype.1; \
 	rm -f prototype && mv prototype.1 prototype; \
-	echo "d none /var ? ? ?" >> prototype; \
+	if test -d /usr/local; then \
+		cat prototype | \
+		sed 's,none /usr/local .*,none /usr/local ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
+	if test -d /usr/local/bin; then \
+		cat prototype | \
+		sed 's,none /usr/local/bin .*,none /usr/local/bin ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
+	if test -d /usr/local/sbin; then \
+		cat prototype | \
+		sed 's,none /usr/local/sbin .*,none /usr/local/sbin ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
+	if test -d /usr/local/man; then \
+		cat prototype | \
+		sed 's,none /usr/local/man .*,none /usr/local/man ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
+	if test -d /usr/local/man/man5; then \
+		cat prototype | \
+		sed 's,none /usr/local/man/man5 .*,none /usr/local/man/man5 ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
+	if test -d /usr/local/man/man8; then \
+		cat prototype | \
+		sed 's,none /usr/local/man/man8 .*,none /usr/local/man/man8 ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
 	echo "d none /etc/rc0.d ? ? ?" >> prototype; \
 	echo "d none /etc/rc1.d ? ? ?" >> prototype; \
@@ -975,7 +1011,7 @@
 	  echo; \
 	  cp /tmp/samhain-pkg-staging/@install_name@.pkg $(PACKAGE)-$(VERSION).pkg; \
-	  echo "Package @install_name@.pkg is ready for installation"; \
+	  echo "Package $(PACKAGE)-$(VERSION).pkg is ready for installation"; \
 	  echo; \
-	  rm -r /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
+	  rm -rf /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
 	else \
 	  echo; \
@@ -993,6 +1029,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; \
@@ -1141,5 +1177,5 @@
 	cp config.h m_comp/; \
 	cp $(srcsrc)/samhain_hide.c m_comp/; \
-	cd m_comp && make modules
+	cd m_comp && $(MAKE) modules
 	@if test -f m_comp/samhain_hide.ko; then \
 	  cp -p m_comp/samhain_hide.ko samhain_hide.ko; \
Index: trunk/aclocal.m4
===================================================================
--- trunk/aclocal.m4	(revision 39)
+++ trunk/aclocal.m4	(revision 40)
@@ -1179,5 +1179,5 @@
     ssp_old_cflags="$CFLAGS"
     CFLAGS="$CFLAGS -fstack-protector"
-    AC_TRY_COMPILE(,,, ssp_cc=no)
+    AC_TRY_LINK(,,, ssp_cc=no)
     # echo $ssp_cc
     if test "X$ssp_cc" = "Xno"; then
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac	(revision 39)
+++ trunk/configure.ac	(revision 40)
@@ -37,5 +37,5 @@
 dnl start
 dnl
-AM_INIT_AUTOMAKE(samhain, 2.2.0)
+AM_INIT_AUTOMAKE(samhain, 2.2.1)
 AC_CANONICAL_HOST
 
Index: trunk/docs/Changelog
===================================================================
--- trunk/docs/Changelog	(revision 39)
+++ trunk/docs/Changelog	(revision 40)
@@ -1,2 +1,9 @@
+2.2.1:
+	* fix Solaris package creation
+	* recognize Solaris doors and event ports
+	* fix the idmef_inode_t patch: provide required info to avoid stat()
+	* fix bug on database update: fill in dev and rdev fields
+	* fix get_file_infos() in sh_prelude.c: avoid premature return	
+	* GCC_STACK_PROTECT_CC: AC_TRY_COMPILE -> AC_TRY_LINK
 	* deploy.sh: allow to set a group for hosts upon installation
 	* patch by Yoann: fix an issue when setting the idmef_inode_t object
Index: trunk/dsys/comINSTALL
===================================================================
--- trunk/dsys/comINSTALL	(revision 39)
+++ trunk/dsys/comINSTALL	(revision 40)
@@ -255,4 +255,12 @@
 	    printINFO "ssh -x -l root ${host} /bin/sh -c '(cd ${tmpdir} && eval ${is_command} ${tmpdir}/samhain-${src_version}.${realformat} ${tmp_iname})'"
         fi
+    elif test "x$format" = "xsolaris-pkg"
+    then
+        if test x"$simulate" = x0
+        then
+            ssh -x -l "root" "${host}" /bin/sh -c \''(cd "'${tmpdir}'" && PATH="'/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH'" && export PATH && eval "'${is_command}'" "'samhain-${src_version}.${realformat} all'") >/dev/null '\'
+        else
+	    printINFO "ssh -x -l root ${host} /bin/sh -c '(cd ${tmpdir} && eval ${is_command} samhain-${src_version}.${realformat}) all'"
+        fi
     elif test "x$format" = "xtbz2"
     then
Index: trunk/include/samhain.h
===================================================================
--- trunk/include/samhain.h	(revision 39)
+++ trunk/include/samhain.h	(revision 40)
@@ -45,7 +45,9 @@
 /* Sizes for arrays (user, group, timestamp).
  */
+#define SOCKPASS_MAX 14
 #define USER_MAX  20
 #define GROUP_MAX 20
 #define TIM_MAX   32
+
 
 /* The number of bytes in a key,  
@@ -262,5 +264,5 @@
 
 typedef struct {
-  char   sh_sockpass[32];
+  char   sh_sockpass[2*SOCKPASS_MAX+2];
   char   sigkey_old[KEY_LEN+1];
   char   sigkey_new[KEY_LEN+1];
Index: trunk/include/sh_unix.h
===================================================================
--- trunk/include/sh_unix.h	(revision 39)
+++ trunk/include/sh_unix.h	(revision 40)
@@ -49,4 +49,6 @@
   SH_FILE_FIFO,
   SH_FILE_SOCKET,
+  SH_FILE_DOOR,
+  SH_FILE_PORT,
   SH_FILE_UNKNOWN
 } ShFileType;
@@ -77,5 +79,5 @@
 /* hardlinks    */
 #define MODI_HLN (1 << 10)
-/* device num   */
+/* device type   */
 #define MODI_RDEV (1 << 11)
 /* size may grow   */
Index: trunk/src/sh_database.c
===================================================================
--- trunk/src/sh_database.c	(revision 39)
+++ trunk/src/sh_database.c	(revision 40)
@@ -1492,5 +1492,5 @@
 }
 
-static int is_escaped(char * p) {
+static int is_escaped(unsigned char * p) {
 
   int    escp = 0;
@@ -1504,4 +1504,8 @@
 	}
       else if ((*p == '\'' || *p == '\"') && escp == 0)
+	{
+	  retv = S_FALSE;
+	}
+      else if (*p > 0x7F)
 	{
 	  retv = S_FALSE;
@@ -1581,4 +1585,7 @@
       p[2] == 'o' && p[3] == 'g')
     {
+      /* 
+       * recursive call 
+       */
       new       = SH_ALLOC(sizeof(dbins));
       init_db_entry(new);
Index: trunk/src/sh_files.c
===================================================================
--- trunk/src/sh_files.c	(revision 39)
+++ trunk/src/sh_files.c	(revision 40)
@@ -102,4 +102,6 @@
   long    NumCDev;
   long    NumBDev;
+  long    NumDoor;
+  long    NumPort;
   long    NumAll;
   long    TotalBytes;
@@ -1607,4 +1609,6 @@
   theDir.NumCDev     = 0;
   theDir.NumBDev     = 0;
+  theDir.NumDoor     = 0;
+  theDir.NumPort     = 0;
   theDir.NumAll      = 0;
   theDir.TotalBytes  = 0;
@@ -1831,4 +1835,6 @@
     else if (checkit == SH_FILE_CDEV)      ++theDir.NumCDev;
     else if (checkit == SH_FILE_BDEV)      ++theDir.NumBDev;
+    else if (checkit == SH_FILE_DOOR)      ++theDir.NumDoor;
+    else if (checkit == SH_FILE_PORT)      ++theDir.NumPort;
     
     SH_FREE(tmpcat);
@@ -2079,4 +2085,6 @@
     case 'b': SL_RETURN(SH_FILE_BDEV, _("sh_files_filecheck"));      
     case '|': SL_RETURN(SH_FILE_FIFO, _("sh_files_filecheck"));      
+    case 'D': SL_RETURN(SH_FILE_DOOR, _("sh_files_filecheck"));    
+    case 'P': SL_RETURN(SH_FILE_PORT, _("sh_files_filecheck"));    
     case 's': SL_RETURN(SH_FILE_SOCKET, _("sh_files_filecheck"));    
     default:  SL_RETURN(SH_FILE_UNKNOWN, _("sh_files_filecheck"));   
Index: trunk/src/sh_hash.c
===================================================================
--- trunk/src/sh_hash.c	(revision 39)
+++ trunk/src/sh_hash.c	(revision 40)
@@ -1998,4 +1998,6 @@
   p.linkmode    = (UINT32) buf->linkmode;
   p.hardlinks   = (UINT32) buf->hardlinks;
+  p.dev   = (UINT64) buf->dev;
+  p.rdev  = (UINT64) buf->rdev;
   p.mode  = (UINT32) buf->mode;
   p.ino   = (UINT32) buf->ino;
@@ -2059,6 +2061,10 @@
 #endif
 
-#ifndef PRIi64
-#define PRIi64 "lld"
+#ifndef PRIu64
+#ifdef  HAVE_LONG_32
+#define PRIu64 "llu"
+#else
+#define PRIu64 "lu"
+#endif
 #endif
 
@@ -2072,8 +2078,8 @@
 #ifdef SH_USE_XML
   sl_snprintf(form_rval, 80, _("%s%s%s%s%s"), 
-	      _("size_old=\"%"), PRIi64, _("\" size_new=\"%"), PRIi64, "\" ");
+	      _("size_old=\"%"), PRIu64, _("\" size_new=\"%"), PRIu64, "\" ");
 #else
   sl_snprintf(form_rval, 80, _("%s%s%s%s%s"), 
-	      _("size_old=<%"), PRIi64, _(">, size_new=<%"), PRIi64, ">, ");
+	      _("size_old=<%"), PRIu64, _(">, size_new=<%"), PRIu64, ">, ");
 #endif
 
@@ -2124,7 +2130,7 @@
 
   if (is_new)
-    format = _("hardlinks_new=\"%ld\" ");
-  else
-    format = _("hardlinks_old=\"%ld\" ");
+    format = _("hardlinks_new=\"%lu\" ");
+  else
+    format = _("hardlinks_old=\"%lu\" ");
   sl_snprintf(tmp, SH_BUFSIZE, format,
 	      (unsigned long) theFile->hardlinks);
@@ -2133,7 +2139,7 @@
 
   if (is_new)
-    format = _("idevice_new=\"%ld\" ");
-  else
-    format = _("idevice_old=\"%ld\" ");
+    format = _("idevice_new=\"%lu\" ");
+  else
+    format = _("idevice_old=\"%lu\" ");
   sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->rdev);
   sl_strlcat(msg, tmp, SH_BUFSIZE); 
@@ -2141,9 +2147,23 @@
 
   if (is_new)
-    format = _("inode_new=\"%ld\" ");
-  else
-    format = _("inode_old=\"%ld\" ");
+    format = _("inode_new=\"%lu\" ");
+  else
+    format = _("inode_old=\"%lu\" ");
   sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->ino);
   sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
+  /* 
+   * also report device for prelude
+   */
+#if defined(HAVE_LIBPRELUDE) && defined(HAVE_LIBPRELUDE_9)
+  if (is_new)
+    format = _("dev_new=\"%lu,%lu\" ");
+  else
+    format = _("dev_old=\"%lu,%lu\" ");
+  sl_snprintf(tmp, SH_BUFSIZE, format,		      
+	      (unsigned long) major(theFile->dev),
+	      (unsigned long) minor(theFile->dev));
+  sl_strlcat(msg, tmp, SH_BUFSIZE);
+#endif
 
 
@@ -2261,7 +2281,7 @@
 
   if (is_new)
-    format = _("hardlinks_new=<%ld>, ");
-  else
-    format = _("hardlinks_old=<%ld>, ");
+    format = _("hardlinks_new=<%lu>, ");
+  else
+    format = _("hardlinks_old=<%lu>, ");
   sl_snprintf(tmp, SH_BUFSIZE, format,
 	      (unsigned long) theFile->hardlinks);
@@ -2270,7 +2290,7 @@
 
   if (is_new)
-    format = _("idevice_new=<%ld>, ");
-  else
-    format = _("idevice_old=<%ld>, ");
+    format = _("idevice_new=<%lu>, ");
+  else
+    format = _("idevice_old=<%lu>, ");
   sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->rdev);
   sl_strlcat(msg, tmp, SH_BUFSIZE); 
@@ -2278,10 +2298,24 @@
 
   if (is_new)
-    format = _("inode_new=<%ld>, ");
-  else
-    format = _("inode_old=<%ld>, ");
+    format = _("inode_new=<%lu>, ");
+  else
+    format = _("inode_old=<%lu>, ");
   sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->ino);
   sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
+
+  /* 
+   * also report device for prelude
+   */
+#if defined(HAVE_LIBPRELUDE) && defined(HAVE_LIBPRELUDE_9)
+  if (is_new)
+    format = _("dev_new=<%lu,%lu>, ");
+  else
+    format = _("dev_old=<%lu,%lu>, ");
+  sl_snprintf(tmp, SH_BUFSIZE, format,		      
+	      (unsigned long) major(theFile->dev),
+	      (unsigned long) minor(theFile->dev));
+  sl_strlcat(msg, tmp, SH_BUFSIZE);
+#endif
 
   if (is_new)
@@ -2729,7 +2763,7 @@
 	  sl_snprintf(tmp, SH_BUFSIZE, 
 #ifdef SH_USE_XML
-		      _("hardlinks_old=\"%ld\" hardlinks_new=\"%ld\" "),
-#else
-		      _("hardlinks_old=<%ld>, hardlinks_new=<%ld>, "),
+		      _("hardlinks_old=\"%lu\" hardlinks_new=\"%lu\" "),
+#else
+		      _("hardlinks_old=<%lu>, hardlinks_new=<%lu>, "),
 #endif
 		      (unsigned long) p->theFile.hardlinks, 
@@ -2746,7 +2780,7 @@
 	  sl_snprintf(tmp, SH_BUFSIZE,
 #ifdef SH_USE_XML 
-		      _("device_old=\"%ld,%ld\" device_new=\"%ld,%ld\" idevice_old=\"%ld\" idevice_new=\"%ld\" "),
-#else
-		      _("device_old=<%ld,%ld>, device_new=<%ld,%ld>, "),
+		      _("device_old=\"%lu,%lu\" device_new=\"%lu,%lu\" idevice_old=\"%lu\" idevice_new=\"%lu\" "),
+#else
+		      _("device_old=<%lu,%lu>, device_new=<%lu,%lu>, "),
 #endif
 		      (unsigned long) major(p->theFile.rdev), 
@@ -2770,7 +2804,7 @@
 	  sl_snprintf(tmp, SH_BUFSIZE,
 #ifdef SH_USE_XML 
-		      _("inode_old=\"%ld\" inode_new=\"%ld\" "),
-#else
-		      _("inode_old=<%ld>, inode_new=<%ld>, "),
+		      _("inode_old=\"%lu\" inode_new=\"%lu\" "),
+#else
+		      _("inode_old=<%lu>, inode_new=<%lu>, "),
 #endif
 		      (unsigned long) p->theFile.ino, 
@@ -2779,7 +2813,36 @@
 #ifdef REPLACE_OLD
 	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
-	    p->theFile.ino = theFile->ino;
-#endif
-	}
+	    {
+	      p->theFile.ino = theFile->ino;
+	      p->theFile.dev = theFile->dev;
+	    }
+#endif
+	}
+
+
+      /* 
+       * also report device for prelude
+       */
+#if defined(HAVE_LIBPRELUDE) && defined(HAVE_LIBPRELUDE_9)
+      if ((modi_mask & MODI_INO) != 0)
+	{
+	  sl_snprintf(tmp, SH_BUFSIZE,
+#ifdef SH_USE_XML 
+		      _("dev_old=\"%lu,%lu\" dev_new=\"%lu,%lu\" "),
+#else
+		      _("dev_old=<%lu,%lu>, dev_new=<%lu,%lu>, "),
+#endif
+		      (unsigned long) major(p->theFile.dev),
+		      (unsigned long) minor(p->theFile.dev),
+		      (unsigned long) major(theFile->dev),
+		      (unsigned long) minor(theFile->dev)
+		      );
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
+	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
+	    p->theFile.dev = theFile->dev;
+#endif
+	}
+#endif
 
       if (   ((modi_mask & MODI_USR) != 0)
@@ -2790,12 +2853,12 @@
 	{
 #ifdef SH_USE_XML
-	  sl_snprintf(tmp, SH_BUFSIZE, _("owner_old=\"%s\" owner_new=\"%s\" iowner_old=\"%ld\" iowner_new=\"%ld\" "),
-#else
-	  sl_snprintf(tmp, SH_BUFSIZE, _("owner_old=<%s>, owner_new=<%s>, "),
-#endif
-		      p->theFile.c_owner, theFile->c_owner
-#ifdef SH_USE_XML
-		      , (long) p->theFile.owner, (long) theFile->owner
-#endif
+	  sl_snprintf(tmp, SH_BUFSIZE, 
+		      _("owner_old=\"%s\" owner_new=\"%s\" iowner_old=\"%ld\" iowner_new=\"%ld\" "),
+#else
+	  sl_snprintf(tmp, SH_BUFSIZE, 
+		      _("owner_old=<%s>, owner_new=<%s>, iowner_old=<%ld>, iowner_new=<%ld>, "),
+#endif
+		      p->theFile.c_owner, theFile->c_owner, 
+		      (long) p->theFile.owner, (long) theFile->owner
 		      );
 	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
@@ -2818,10 +2881,13 @@
 	{
 #ifdef SH_USE_XML
-	  sl_snprintf(tmp, SH_BUFSIZE, _("group_old=\"%s\" group_new=\"%s\" igroup_old=\"%ld\" igroup_new=\"%ld\" "),
+	  sl_snprintf(tmp, SH_BUFSIZE, 
+		      _("group_old=\"%s\" group_new=\"%s\" igroup_old=\"%ld\" igroup_new=\"%ld\" "),
 		      p->theFile.c_group, theFile->c_group,
 		      (long) p->theFile.group, (long) theFile->group);
 #else
-	  sl_snprintf(tmp, SH_BUFSIZE, _("group_old=<%s>, group_new=<%s>, "),
-		      p->theFile.c_group, theFile->c_group);
+	  sl_snprintf(tmp, SH_BUFSIZE, 
+		      _("group_old=<%s>, group_new=<%s>, igroup_old=<%ld>, igroup_new=<%ld>, "),
+		      p->theFile.c_group, theFile->c_group,
+		      (long) p->theFile.group, (long) theFile->group);
 #endif
 
@@ -3153,6 +3219,6 @@
   if (ListWithDelimiter == S_TRUE)
     {
-      printf(_("%7ld, %10s, %5d, %12s, %5d, %3d, %-8s, %5d, %-8s, %5d, "),
-	     (unsigned long) p->theFile.ino,
+      printf(_("%7ld, %7ld, %10s, %5d, %12s, %5d, %3d, %-8s, %5d, %-8s, %5d, "),
+	     (unsigned long) p->theFile.ino, (unsigned long) p->theFile.dev,
 	     p->theFile.c_mode, (int) p->theFile.mode,
 	     p->theFile.c_attributes, (int) p->theFile.attributes,
@@ -3163,6 +3229,6 @@
   else
     {
-      printf(_("%7ld %10s %5d %12s %5d %3d %-8s %5d %-8s %5d "),
-	     (unsigned long) p->theFile.ino,
+      printf(_("%7ld %7ld %10s %5d %12s %5d %3d %-8s %5d %-8s %5d "),
+	     (unsigned long) p->theFile.ino, (unsigned long) p->theFile.dev,
 	     p->theFile.c_mode, (int) p->theFile.mode,
 	     p->theFile.c_attributes, (int) p->theFile.attributes,
@@ -3173,7 +3239,7 @@
 
   if ('c' == p->theFile.c_mode[0] || 'b' == p->theFile.c_mode[0])
-    sl_snprintf(str, 80, "%"PRIi64, p->theFile.rdev);
-  else
-    sl_snprintf(str, 80, "%"PRIi64, p->theFile.size);
+    sl_snprintf(str, 80, "%"PRIu64, p->theFile.rdev);
+  else
+    sl_snprintf(str, 80, "%"PRIu64, p->theFile.size);
 
   printf( _(" %8s"), str);
Index: trunk/src/sh_prelude.c
===================================================================
--- trunk/src/sh_prelude.c	(revision 39)
+++ trunk/src/sh_prelude.c	(revision 40)
@@ -39,5 +39,4 @@
 #include <string.h>
 #include <sys/types.h>
-#include <sys/stat.h>
 
 #if TIME_WITH_SYS_TIME
@@ -56,16 +55,7 @@
 #endif
 
-#ifdef MAJOR_IN_MKDEV
-# include <sys/mkdev.h>
-#else
-# ifdef MAJOR_IN_SYSMACROS
-#  include <sys/sysmacros.h>
-# endif
-#endif
-
 #include <unistd.h>
 #include <syslog.h>
 #include <pwd.h>
-#include <grp.h>
 
 int     sh_argc_store;
@@ -412,8 +402,7 @@
                 if ( ptr ) {
                         ret = idmef_file_new_name(file, &str);
-                        if ( ret < 0 )
-                                return;
-                        
-                        prelude_string_set_dup(str, ptr + 1);
+                        if ( ret == 0 ) {
+			        prelude_string_set_dup(str, ptr + 1);
+			}
                 }
         }
@@ -428,10 +417,7 @@
         if ( ptr ) {
                 ret = idmef_time_from_samhain(&time, ptr);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        return;
-		}
-                
-                idmef_file_set_modify_time(file, time);
+                if ( ret == 0 ) {
+                        idmef_file_set_modify_time(file, time);
+		}
                 free(ptr);
         }
@@ -440,10 +426,7 @@
         if ( ptr ) {
                 ret = idmef_time_from_samhain(&time, ptr);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        return;
-		}
-
-                idmef_file_set_create_time(file, time);
+                if ( ret == 0 ) {
+                        idmef_file_set_create_time(file, time);
+		}
                 free(ptr);
         }
@@ -451,21 +434,18 @@
         ptr = get_value(msg, _("inode"), suffix);
         if ( ptr ) {
-                struct stat st;
-
-                ret = lstat(prelude_string_get_string(idmef_file_get_path(file)), &st);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        return;
-		}
-
                 ret = idmef_file_new_inode(file, &inode);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        return;
-		}
-                
-                idmef_inode_set_major_device(inode, major(st.st_dev));
-                idmef_inode_set_minor_device(inode, minor(st.st_dev));
-                idmef_inode_set_number(inode, strtoul(ptr, NULL, 10));
+                if ( ret == 0 ) {
+			char * dev = get_value(msg, _("dev"), suffix);
+			if (dev) {
+			        char * q = strchr(dev, ',');
+				if (*q) {
+				         *q = '\0'; ++q;
+					 idmef_inode_set_major_device(inode, strtoul(dev, NULL, 0));
+					 idmef_inode_set_minor_device(inode, strtoul(  q, NULL, 0));
+				}
+				free(dev);
+			}
+			idmef_inode_set_number(inode, strtoul(ptr, NULL, 10));
+		}
                 free(ptr);
         }
@@ -475,6 +455,6 @@
                 ret = idmef_file_new_checksum(file, &checksum, IDMEF_LIST_APPEND);
                 if ( ret < 0 ) {
-                        free(ptr);
-                        return;
+			free(ptr);
+			goto get_mode;
 		}
 
@@ -482,26 +462,28 @@
 
 		if (hashtype == 0)
-                        idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_TIGER);
-
-                else if (hashtype == 1)
-                        idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_SHA1);
-
-                else if (hashtype == 2)
-                        idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_MD5);
-
-                else
-                        idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_TIGER);
-
-
-                ret = idmef_checksum_new_value(checksum, &str);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        return;
+			idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_TIGER);
+
+		else if (hashtype == 1)
+			idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_SHA1);
+		
+		else if (hashtype == 2)
+			idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_MD5);
+		
+		else
+			idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_TIGER);
+
+
+		ret = idmef_checksum_new_value(checksum, &str);
+		if ( ret < 0 ) {
+			free(ptr);
+			goto get_mode;
 		}
 
 		/* will be freed on destroy()
 		 */
-                prelude_string_set_nodup(str, ptr);
-        }
+		prelude_string_set_nodup(str, ptr);
+	}
+
+ get_mode:
 
 	mode = get_value(msg, _("mode"), suffix);
@@ -510,10 +492,10 @@
                 ret = idmef_file_new_file_access(file, &access, IDMEF_LIST_APPEND);
                 if ( ret < 0 )
-                        goto mode_free;
+                        goto get_owner;
 
 	        /* flawfinder: ignore *//* is part of name, not access() */
                 ret = idmef_file_access_new_user_id(access, &userid);
                 if ( ret < 0 )
-                        goto mode_free;
+                        goto get_owner;
                 idmef_user_id_set_type(userid, IDMEF_USER_ID_TYPE_OTHER_PRIVS);
 
@@ -521,8 +503,10 @@
 		get_access_info ( access, mode, 7, 9 );
         }
+
+ get_owner:
  
         ptr = get_value(msg, _("owner"), suffix);
         if ( ptr ) {
-                struct passwd *pw;
+	        char * uid;
                 
 	        /* flawfinder: ignore *//* is part of name, not access() */
@@ -530,5 +514,5 @@
                 if ( ret < 0 ) {
                         free(ptr);
-                        goto mode_free;
+                        goto get_group;
 		}
 
@@ -537,5 +521,5 @@
                 if ( ret < 0 ) {
                         free(ptr);
-                        goto mode_free;
+                        goto get_group;
 		}
                 idmef_user_id_set_type(userid, IDMEF_USER_ID_TYPE_USER_PRIVS);
@@ -544,13 +528,13 @@
                 if ( ret < 0 ) {
                         free(ptr);
-                        goto mode_free;
+                        goto get_group;
                 }
                 prelude_string_set_nodup(str, ptr);
                 
-                pw = getpwnam(ptr);
-                if ( ! pw )
-                        goto mode_free;
-                
-                idmef_user_id_set_number(userid, pw->pw_uid);
+                uid = get_value(msg, _("iowner"), suffix);
+                if ( ! uid )
+                        goto get_group;
+                
+                idmef_user_id_set_number(userid, strtoul(uid, NULL, 0));
 
 		if ( mode ) {
@@ -558,9 +542,13 @@
 		        get_access_info ( access, mode, 1, 3 );
 		}
-        }
+
+		free(uid);
+        }
+
+ get_group:
 
         ptr = get_value(msg, _("group"), suffix);
         if ( ptr ) {
-                struct group *gr;
+                char *gid;
                 
 	        /* flawfinder: ignore *//* is part of name, not access() */
@@ -587,13 +575,15 @@
                 prelude_string_set_nodup(str, ptr);
 
-                gr = getgrnam(ptr);
-                if ( ! gr )
+                gid = get_value(msg, _("igroup"), suffix);
+                if ( ! gid )
                         goto mode_free;
 
-                idmef_user_id_set_number(userid, gr->gr_gid);
+                idmef_user_id_set_number(userid, strtoul(gid, NULL, 0));
 
 		if ( mode ) {
 		        get_access_info ( access, mode, 4, 6 ); /* flawfinder: ignore */
 		}
+
+		free(gid);
         }
 
Index: trunk/src/sh_socket.c
===================================================================
--- trunk/src/sh_socket.c	(revision 39)
+++ trunk/src/sh_socket.c	(revision 40)
@@ -111,6 +111,5 @@
 int    pf_unix_fd  = -1;
 static char * sh_sockname = NULL;
-/* static char   sh_sockpass[29]; */
-static char   sh_sockpass_real[15];
+static char   sh_sockpass_real[SOCKPASS_MAX+1];
 
 struct socket_cmd {
@@ -226,5 +225,5 @@
 {
   int j = 0;
-  while (skey->sh_sockpass[2*j] != '\0')
+  while (skey->sh_sockpass[2*j] != '\0' && j < sizeof(sh_sockpass_real))
     {
       sh_sockpass_real[j] = skey->sh_sockpass[2*j];
@@ -309,8 +308,8 @@
 
   i = sl_strlen(c);
-  if (i > 14) {
+  if (i > SOCKPASS_MAX) {
     return -1;
   }
-  for (j = 0; j < 29; ++j)
+  for (j = 0; j < (2*SOCKPASS_MAX+1); ++j)
     {
       skey->sh_sockpass[j] = '\0';
@@ -556,5 +555,5 @@
 
   iov.iov_base = (char *) &message;
-  iov.iov_len  = SH_MAXMSG;
+  iov.iov_len  = sizeof(message);
 
   memset (&msg, 0, sizeof (msg));
@@ -626,7 +625,7 @@
 #endif
 
-  /* nbytes = recv (talkfd, message, SH_MAXMSG, 0); */
-
-  message[SH_MAXMSG-1] = '\0';
+  /* msg.msg_iov.iov_base, filled by recvmsg
+   */
+  message[sizeof(message)-1] = '\0';
 
   if (nbytes < 0)
@@ -684,5 +683,9 @@
   if (eopw) 
     *eopw = '\0';
-  if (0 == strcmp(goodpassword, message))
+  /*
+   * message is null-terminated and >> goodpassword
+   */
+  if (0 == strcmp(goodpassword, message) &&
+      strlen(goodpassword) < (sizeof(message)/2))
     {
       client_uid = sh_socket_flaguid;
@@ -808,5 +811,5 @@
       while (list_cmd)
 	{
-	  sl_snprintf(message, SH_MAXMSG, _("SENT  %8s  %32s  %s"),
+	  sl_snprintf(message, sizeof(message), _("SENT  %8s  %32s  %s"),
 		      list_cmd->cmd, list_cmd->clt, list_cmd->cti);
 	  /*
@@ -835,5 +838,5 @@
   while (list_cmd)
     {
-      sl_snprintf(message, SH_MAXMSG, _(">>>>  %8s  %32s  %s"),
+      sl_snprintf(message, sizeof(message), _(">>>>  %8s  %32s  %s"),
 		  list_cmd->cmd, list_cmd->clt, list_cmd->cti);
       /*
@@ -964,5 +967,5 @@
     }
 
-  sl_strlcpy(cancel_cmd, _("CANCEL"), SH_MAXMSGLEN); 
+  sl_strlcpy(cancel_cmd, _("CANCEL"), sizeof(cancel_cmd)); 
 
   while (sh_socket_read (&cmd) > 0)
@@ -994,5 +997,5 @@
       if (0 == sl_strcmp(new->clt, client_name))
 	{
-	  sl_strlcpy(out, new->cmd, SH_MAXMSGLEN);
+	  sl_strlcpy(out, new->cmd, sizeof(out));
 	  sh_socket_add2run (new);
 	  sh_socket_rm2list  (client_name);
Index: trunk/src/sh_unix.c
===================================================================
--- trunk/src/sh_unix.c	(revision 39)
+++ trunk/src/sh_unix.c	(revision 40)
@@ -120,4 +120,21 @@
 #endif
 #endif
+
+#if defined(S_IFDOOR) && !defined(S_ISDOOR)
+#define S_ISDOOR(mode) (((mode) & S_IFMT) == S_IFDOOR)
+#else
+#if !defined(S_ISDOOR)
+#define S_ISDOOR(mode) (0)
+#endif
+#endif
+
+#if defined(S_IFPORT) && !defined(S_ISPORT)
+#define S_ISPORT(mode) (((mode) & S_IFMT) == S_IFPORT)
+#else
+#if !defined(S_ISPORT)
+#define S_ISPORT(mode) (0)
+#endif
+#endif
+
 
 #undef  FIL__
@@ -2674,4 +2691,12 @@
     c_mode[0] = 's';
   }
+  else if ( S_ISDOOR(buf->st_mode) ) {
+    (*type)   = SH_FILE_DOOR;
+    c_mode[0] = 'D';
+  }
+  else if ( S_ISPORT(buf->st_mode) ) {
+    (*type)   = SH_FILE_PORT;
+    c_mode[0] = 'P';
+  }
   else                              {
     (*type)   = SH_FILE_UNKNOWN;
