Index: trunk/man/samhainrc.5
===================================================================
--- trunk/man/samhainrc.5	(revision 76)
+++ trunk/man/samhainrc.5	(revision 77)
@@ -593,4 +593,7 @@
 for all.
 .br
+.BI FilenamesAreUTF8= yes|no
+Whether filenames are UTF-8 encoded (defaults to no). If yes, filenames
+are checked for invalid UTF-8 encoding and for ending in invisible characters.
 .br
 .BI IgnoreAdded= path_regex
Index: trunk/src/sh_files.c
===================================================================
--- trunk/src/sh_files.c	(revision 76)
+++ trunk/src/sh_files.c	(revision 77)
@@ -2031,14 +2031,7 @@
   ++sh.statistics.files_checked;
       
-  if      ( sh.flag.checkSum == SH_CHECK_INIT && sh.flag.update == S_FALSE ) 
+  if ( sh.flag.checkSum == SH_CHECK_INIT /* && sh.flag.update == S_FALSE */) 
     {
       sh_hash_pushdata (&theFile, fileHash);
-    }
-  else if (sh.flag.checkSum == SH_CHECK_INIT && sh.flag.update == S_TRUE )
-    {
-      if (0 == sh_hash_compdata (class, &theFile, fileHash, NULL, -1))
-	{
-	  sh_hash_pushdata (&theFile, fileHash);
-	}
     }
   else if (sh.flag.checkSum == SH_CHECK_CHECK 
Index: trunk/src/sh_hash.c
===================================================================
--- trunk/src/sh_hash.c	(revision 76)
+++ trunk/src/sh_hash.c	(revision 77)
@@ -535,19 +535,10 @@
 	    }
 
-	  /* We rewrite the db on update, thus we need to push this out
+	  /* We rewrite the db on update, thus we need to keep this
 	   * if the user does not want to purge it from the db.
 	   */
-	  if (sh.flag.checkSum == SH_CHECK_INIT && 
-	      sh.flag.update   == S_TRUE &&
-	      S_FALSE          == sh_util_ask_update(p->fullpath))
-	    {
-	      theFile = sh_hash_create_ft (p, fileHash);
-	      sh_hash_pushdata (theFile, fileHash);
-	      if (theFile->attr_string)
-		SH_FREE(theFile->attr_string);
-	      SH_FREE(theFile);
-	    }
-
-	  if (sh.flag.reportonce == S_TRUE)
+
+	  if ((sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) || 
+	      (S_TRUE == sh.flag.update && S_TRUE == sh_util_ask_update(p->fullpath)))
 	    {
 #ifdef REPLACE_OLD
@@ -2611,13 +2602,4 @@
   if (p == NULL) 
     {
-      if (sh.flag.reportonce == S_TRUE)
-	{
-	  p = sh_hash_push_int(theFile, fileHash);
-	  hashinsert (p);
-	  if (p)
-	    p->modi_mask = theFile->check_mask;
-
-	}
-
       if (S_FALSE == sh_ignore_chk_new(theFile->fullpath))
 	{
@@ -2637,12 +2619,28 @@
       if (sh.flag.reportonce == S_TRUE)
 	theFile->reported = S_TRUE;
-	
-      if (sh.flag.isdaemon == S_FALSE && sh.flag.update == S_TRUE )
-	{
-	  if (S_FALSE == sh_util_ask_update (theFile->fullpath))
+
+      if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
+	{
+	  p = sh_hash_push_int(theFile, fileHash);
+	  hashinsert (p);
+	  if (p)
+	    p->modi_mask = theFile->check_mask;
+	}
+
+      else if (S_TRUE == sh.flag.update)
+	{
+	  if (S_TRUE == sh_util_ask_update (theFile->fullpath))
+	    {
+	      p = sh_hash_push_int(theFile, fileHash);
+	      hashinsert (p);
+	      if (p)
+		p->modi_mask = theFile->check_mask;
+	    }
+	  else
 	    {
 	      SL_RETURN(1, _("sh_hash_compdata"));
-	    } 
-	}
+	    }
+	}
+	
       SL_RETURN(0, _("sh_hash_compdata"));
     }
@@ -3264,5 +3262,5 @@
 	      SL_RETURN(1, _("sh_hash_compdata"));
 	    }
-	  else if (sh.flag.reportonce == S_TRUE)
+	  else /* if (sh.flag.reportonce == S_TRUE) */
 	    {
 	      /* we replace the data in the in-memory copy of the
Index: trunk/src/sh_processcheck.c
===================================================================
--- trunk/src/sh_processcheck.c	(revision 76)
+++ trunk/src/sh_processcheck.c	(revision 77)
@@ -163,4 +163,10 @@
 static const short SH_PR_ANY      = 0x1000;
 
+/* /proc: 
+ *        linux:     /proc/pid/exe
+ *        freebsd:   /proc/pid/file
+ *        solaris10: /proc/pid/path/a.out
+ */
+
 struct watchlist {
   char        * str;
Index: trunk/src/sh_readconf.c
===================================================================
--- trunk/src/sh_readconf.c	(revision 76)
+++ trunk/src/sh_readconf.c	(revision 77)
@@ -867,5 +867,5 @@
   { N_("addokchars"),         SH_SECTION_MISC,   SH_SECTION_NONE,
     sh_util_obscure_ok },
-  { N_("filenamesareutf8"),   SH_SECTION_MISC,   SH_SECTION_NONE, /* FIXME document this option */
+  { N_("filenamesareutf8"),   SH_SECTION_MISC,   SH_SECTION_NONE,
     sh_util_obscure_utf8 },
   { N_("setrecursionlevel"),  SH_SECTION_MISC,   SH_SECTION_NONE, 
