Index: /trunk/Makefile.in
===================================================================
--- /trunk/Makefile.in	(revision 285)
+++ /trunk/Makefile.in	(revision 286)
@@ -1690,5 +1690,5 @@
 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_forward.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.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_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)/zAVLTree.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)/zAVLTree.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_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_calls.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_files.h $(srcinc)/sh_forward.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.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_unix.h $(srcinc)/sh_utils.h 
Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac	(revision 285)
+++ /trunk/configure.ac	(revision 286)
@@ -12,5 +12,5 @@
 dnl start
 dnl
-AM_INIT_AUTOMAKE(samhain, 2.7.0)
+AM_INIT_AUTOMAKE(samhain, 2.7.1)
 AC_DEFINE([SAMHAIN], 1, [Application is samhain])
 AC_CANONICAL_HOST
Index: /trunk/depend.dep
===================================================================
--- /trunk/depend.dep	(revision 285)
+++ /trunk/depend.dep	(revision 286)
@@ -5,5 +5,5 @@
 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_forward.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.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_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)/zAVLTree.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)/zAVLTree.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_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_calls.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_files.h $(srcinc)/sh_forward.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.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_unix.h $(srcinc)/sh_utils.h 
Index: /trunk/depend.sum
===================================================================
--- /trunk/depend.sum	(revision 285)
+++ /trunk/depend.sum	(revision 286)
@@ -1,1 +1,1 @@
-3825914950
+3590773370
Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 285)
+++ /trunk/docs/Changelog	(revision 286)
@@ -1,3 +1,6 @@
 2.7.1:
+	* samhain_kmem.c: fix compile problems
+	* fix problems with config file parser: increase max. line length,
+	  support quoting/escaping of filenames (as in 'ls --quoting-style=c')
 	* check for pcre_dfa_exec (not available in old versions
 	  of libpcre, reported by Shinoj)
Index: /trunk/src/kern_head.c
===================================================================
--- /trunk/src/kern_head.c	(revision 285)
+++ /trunk/src/kern_head.c	(revision 286)
@@ -98,15 +98,4 @@
   char    * kmap;
 
-
-  /* first, try read()
-   */
-  int  ret_old = kmem_read (fd, addr, buf, len); 
-
-  if (ret_old == 0)
-    return ret_old;
-
-  if (verbose)
-    fprintf(stderr, "kmem_mmap: read() failed, now trying mmap()\n");
-
   sz = getpagesize(); /* unistd.h */
 
@@ -117,7 +106,16 @@
   if (kmap == MAP_FAILED)
     {
+      /* then, try read()
+       */
+      if (verbose)
+	fprintf(stderr, "kmem_mmap: mmap() failed, now trying read()\n");
+
+      if (0 == sh_kern_kmem_read (fd, addr, buf, len))
+	return 0;
+
       perror("kmem_mmap: mmap");
       return -1;
     }
+
   memcpy (buf, &kmap[roff], len);
       
Index: /trunk/src/samhain_kmem.c
===================================================================
--- /trunk/src/samhain_kmem.c	(revision 285)
+++ /trunk/src/samhain_kmem.c	(revision 286)
@@ -15,4 +15,5 @@
 #define _(string) string
 
+#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -36,7 +37,8 @@
 #include <linux/backing-dev.h>
 #include <linux/bootmem.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22)
 #include <linux/splice.h>
+#endif
 #include <linux/pfn.h>
-#include <linux/version.h>
 
 #include <asm/uaccess.h>
@@ -514,6 +516,11 @@
 {
   loff_t ret;
-  
+ 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) 
+  mutex_lock(&file->f_dentry->d_inode->i_mutex);
+#else
   mutex_lock(&file->f_path.dentry->d_inode->i_mutex);
+#endif
+
   switch (orig) {
   case 0:
@@ -533,5 +540,9 @@
     ret = -EINVAL;
   }
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) 
+  mutex_unlock(&file->f_dentry->d_inode->i_mutex);
+#else
   mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
+#endif
   return ret;
 }
Index: /trunk/src/sh_files.c
===================================================================
--- /trunk/src/sh_files.c	(revision 285)
+++ /trunk/src/sh_files.c	(revision 286)
@@ -23,4 +23,5 @@
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
 #include <limits.h>
 
@@ -72,4 +73,121 @@
 #undef  FIL__
 #define FIL__  _("sh_files.c")
+
+static char * sh_files_C_dequote (char * s, size_t * length)
+{
+  size_t i, j, len = *length;
+  int    flag = 0;
+  char  *p, *q, *po, *pend;
+  
+  /* search for backslash
+   */
+  for (i = 0; i < len; ++i)
+    {
+      if (s[i] == '\\')
+	{
+	  flag = 1;
+	  break;
+	}
+    }
+
+  if (flag == 0 || *s == '\0')
+    return s;
+
+  po = SH_ALLOC(len+1); *po = '\0'; p = po; pend = &po[len];
+
+  i = 0; j = 0; q = s;
+
+  do
+    {
+      if (*q == '\\')
+	{
+	  ++q;
+
+	  if (*q == '\0')
+	    { *p = *q; flag = 0; break; }
+	  else if (*q == 'a')
+	    { *p = '\a'; ++p; ++q; }
+	  else if (*q == 'b')
+	    { *p = '\b'; ++p; ++q; }
+	  else if (*q == 'f')
+	    { *p = '\f'; ++p; ++q; }
+	  else if (*q == 'n')
+	    { *p = '\n'; ++p; ++q; }
+	  else if (*q == 'r')
+	    { *p = '\r'; ++p; ++q; }
+	  else if (*q == 't')
+	    { *p = '\t'; ++p; ++q; }
+	  else if (*q == 'v')
+	    { *p = '\v'; ++p; ++q; }
+	  else if (*q == '\\')
+	    { *p = '\\'; ++p; ++q; }
+	  else if (*q == '\'')
+	    { *p = '\''; ++p; ++q; }
+	  else if (*q == '"')
+	    { *p = '"';  ++p; ++q; }
+	  else if (*q == 'x')
+	    {
+	      if (isxdigit((int) q[1]) && isxdigit((int) q[2]))
+		{
+		  /* hexadecimal value following */
+		  unsigned char cc = (16 * sh_util_hexchar(q[1])) 
+		    + sh_util_hexchar(q[2]);
+		  *p = (char) cc;
+		  ++p; q += 3;
+		}
+	      else
+		{
+		  *p = '\0'; flag = 0; break;
+		}
+	    }
+	  else if (isdigit((int)*q))
+	    {
+	      if (isdigit((int) q[1]) && q[1] < '8' && 
+		  isdigit((int) q[2]) && q[2] < '8')
+		{
+		  /* octal value following */
+		  char tmp[4];  unsigned char cc;
+		  tmp[0] = *q; ++q; tmp[1] = *q; ++q; tmp[2] = *q; ++q; 
+		  tmp[3] = '\0';
+		  cc = strtol(tmp, NULL, 8);
+		  *p = (char) cc; ++p;
+		}
+	      else
+		{
+		  *p = '\0'; flag = 0; break;
+		}
+	    }
+	  else
+	    {
+	      /* invalid escape sequence */
+	      *p = '\0'; flag = 0; break;
+	    }
+	}
+      else
+	{
+	  *p = *q; 
+	  ++p; ++q;
+	}
+    } while (*q && p <= pend);
+
+  SL_REQUIRE (p <= pend, _("p <= pend"));
+
+  if (flag)
+    {
+      *p = '\0';
+      *length = strlen(po);
+    }
+  else
+    {
+      SH_FREE(po);
+      po = NULL;
+      *length = 0;
+    }
+
+  SL_REQUIRE (*length <= len, _("*length <= len"));
+
+  SH_FREE(s);
+  return po;
+}
 
 extern int flag_err_debug;
@@ -999,8 +1117,27 @@
     }
 
-  if (str_s == NULL) 
+  if (str_s == NULL || str_s[0] == '\0') 
     SL_RETURN((-1),_("sh_files_pushfile"));
 
   len = sl_strlen(str_s);
+
+  if ( (str_s[0] == '"'  && str_s[len-1] == '"' ) ||
+       (str_s[0] == '\'' && str_s[len-1] == '\'') )
+    {
+      if (len < 3)
+	SL_RETURN((-1),_("sh_files_pushfile"));
+      --len;
+      p = sh_util_strdup_l(&str_s[1], len);
+      p[len-1] = '\0';
+      --len;
+    }
+  else
+    {
+      p = sh_util_strdup_l(str_s, len);
+    }
+
+  p = sh_files_C_dequote(p, &len);
+  if (!p || len == 0)
+    SL_RETURN((-1), _("sh_files_pushdir"));
 
   if (len >= PATH_MAX) 
@@ -1008,5 +1145,5 @@
       /* Name too long
        */
-      tmp = sh_util_safe_name (str_s);
+      tmp = sh_util_safe_name (p);
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_2LONG,
 		       tmp);
@@ -1014,15 +1151,9 @@
       SL_RETURN((-1),_("sh_files_pushfile"));
     } 
-  else if (len < 1) 
-    {
-      /* Should not happen (str_s == NULL caught further above)
-       */
-      SL_RETURN((-1),_("sh_files_pushfile"));
-    } 
-  else if (str_s[0] != '/') 
+  else if (p[0] != '/') 
     {
       /* Not an absolute path
        */
-      tmp = sh_util_safe_name (str_s);
+      tmp = sh_util_safe_name (p);
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_NOPATH,
 		       tmp);
@@ -1035,5 +1166,4 @@
        * special case of the root directory.
        */
-      p = sh_util_strdup (str_s);
       if (p[len-1] == '/' && len > 1)
 	{
@@ -1041,5 +1171,4 @@
 	  --len;
 	}
-      
     } 
 
@@ -1364,8 +1493,27 @@
   }
 
-  if (str_s == NULL)
+  if (str_s == NULL || str_s[0] == '\0') 
+    SL_RETURN((-1),_("sh_files_pushdir"));
+
+  len = sl_strlen(str_s);
+
+  if ( (str_s[0] == '"'  && str_s[len-1] == '"' ) ||
+       (str_s[0] == '\'' && str_s[len-1] == '\'') )
+    {
+      if (len < 3)
+	SL_RETURN((-1),_("sh_files_pushdir"));
+      --len;
+      p = sh_util_strdup_l(&str_s[1], len);
+      p[len-1] = '\0';
+      --len;
+    }
+  else
+    {
+      p = sh_util_strdup_l(str_s, len);
+    }
+
+  p = sh_files_C_dequote(p, &len);
+  if (!p || len == 0)
     SL_RETURN((-1), _("sh_files_pushdir"));
-  
-  p = sh_util_strdup (str_s);
 
   if (p[0] != '/')
@@ -1412,5 +1560,4 @@
   else 
     {
-      
       if (tail[len-1] == '/' && len > 1)
 	{
@@ -1418,5 +1565,4 @@
 	  --len;
 	}
-      
     } 
 
@@ -2420,2 +2566,100 @@
 
 #endif
+
+#ifdef SH_CUTEST
+#include "CuTest.h"
+
+void Test_file_dequote (CuTest *tc)
+{
+#if (defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)) 
+
+  char str1[]  = "1234567890";
+  char str1a[] = "123456\\\"789\\r";
+  char str1b[] = "12345678\\r9";
+  char str1c[] = "12345678\\x0a_9";
+  char str1d[] = "12345678\\007_9";
+  char str1e[] = "123456789\\\\";
+
+  char str2[] = "1234567890\\xw";
+  char str3[] = "1234567890\\xw99";
+  char str4[] = "1234567890\\0ww";
+  char str5[] = "12345\\g67890";
+  char str6[] = "1234567890\\009a";
+
+  char *s, *p, *q;
+  size_t lo, lr;
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str1, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertPtrNotNull(tc, q);
+  CuAssertTrue(tc, p  == q);
+  CuAssertTrue(tc, lr == lo);
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str1a, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertPtrNotNull(tc, q);
+  CuAssertTrue(tc, p  != q);
+  CuAssertTrue(tc, 0 == strcmp(q, "123456\"789\r"));
+  CuAssertTrue(tc, lr == (lo-2));
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str1b, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertPtrNotNull(tc, q);
+  CuAssertTrue(tc, p  != q);
+  CuAssertTrue(tc, 0 == strcmp(q, "12345678\r9"));
+  CuAssertTrue(tc, lr == (lo-1));
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str1c, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertPtrNotNull(tc, q);
+  CuAssertTrue(tc, p  != q);
+  CuAssertTrue(tc, 0 == strcmp(q, "12345678\x0a_9"));
+  CuAssertTrue(tc, lr == (lo-3));
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str1d, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertPtrNotNull(tc, q);
+  CuAssertTrue(tc, p  != q);
+  CuAssertTrue(tc, 0 == strcmp(q, "12345678\007_9"));
+  CuAssertTrue(tc, lr == (lo-3));
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str1e, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertPtrNotNull(tc, q);
+  CuAssertTrue(tc, p  != q);
+  CuAssertTrue(tc, 0 == strcmp(q, "123456789\\"));
+  CuAssertTrue(tc, lr == (lo-1));
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str2, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertTrue(tc, q == NULL);
+  CuAssertTrue(tc, lr == 0);
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str3, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertTrue(tc, q == NULL);
+  CuAssertTrue(tc, lr == 0);
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str4, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertTrue(tc, q == NULL);
+  CuAssertTrue(tc, lr == 0);
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str5, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertTrue(tc, q == NULL);
+  CuAssertTrue(tc, lr == 0);
+
+  s = SH_ALLOC(64); sl_strlcpy(s, str6, 64); p = s; lo = strlen(s); lr = lo;
+  q = sh_files_C_dequote(s, &lr);
+  CuAssertTrue(tc, q == NULL);
+  CuAssertTrue(tc, lr == 0);
+
+  return;
+#else
+  (void) tc; /* fix compiler warning */
+  return;
+#endif
+}
+#endif
+
Index: /trunk/src/sh_kern.c
===================================================================
--- /trunk/src/sh_kern.c	(revision 285)
+++ /trunk/src/sh_kern.c	(revision 286)
@@ -495,9 +495,4 @@
   char    * kmap;
 
-  /* first, try read()
-   */
-  if (0 == sh_kern_kmem_read (fd, addr, buf, len))
-    return 0;
-
   /* next, try mmap()
    */
@@ -511,7 +506,13 @@
   if (kmap == MAP_FAILED)
     {
+      /* then, try read()
+       */
+      if (0 == sh_kern_kmem_read (fd, addr, buf, len))
+	return 0;
+
       memset(buf, '\0', len);
       return -1;
     }
+
   memcpy (buf, &kmap[roff], len);
   return munmap(kmap, len+sz);
Index: /trunk/src/sh_readconf.c
===================================================================
--- /trunk/src/sh_readconf.c	(revision 285)
+++ /trunk/src/sh_readconf.c	(revision 286)
@@ -340,5 +340,6 @@
   char * tmp;
 
-  char   line_in[512+2];
+#define SH_LINE_IN 16384
+  char * line_in;
   char * line;
 
@@ -373,7 +374,11 @@
 
       if (!SL_ISERROR(fd))
-	local_file = 0;
+	{
+	  local_file = 0;
+	}
       else if (sh.flag.checkSum != SH_CHECK_INIT)
-	aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+	{
+	  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+	}
       else
 	{
@@ -427,4 +432,6 @@
   sl_rewind (fd);
 
+  line_in = SH_ALLOC(SH_LINE_IN);
+
 #if defined(SH_STEALTH) && !defined(SH_STEALTH_MICRO)
     /* extract the data and copy to temporary file
@@ -434,5 +441,5 @@
   sh_unix_getline_stealth (0, NULL, 0); /* initialize */
 
-  while ( sh_unix_getline_stealth (fd, line_in, 512) > 0) {
+  while ( sh_unix_getline_stealth (fd, line_in, SH_LINE_IN-2) > 0) {
     hidden_count++;
     if (line_in[0] == '\n')
@@ -451,5 +458,5 @@
       break;
 #endif
-    if (hidden_count > 4096)  /* arbitrary safeguard */
+    if (hidden_count > 1048576)  /* arbitrary safeguard, 1024*1024 */
       break;
   }
@@ -464,5 +471,5 @@
   conf_line = 0;
 
-  while ( sh_unix_getline (fd, line_in, 512) > 0) {
+  while ( sh_unix_getline (fd, line_in, SH_LINE_IN-2) > 0) {
 
     ++conf_line;
@@ -502,4 +509,5 @@
 	    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORT1,
 			     sh.prg_name);
+	    SH_FREE(line_in);
 	    aud_exit (FIL__, __LINE__,EXIT_FAILURE);
 	  }
@@ -660,5 +668,8 @@
   sl_rewind (fd);
   if (0 != sh_gpg_check_sign (fd, 0, 1))
-    aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+    {
+      SH_FREE(line_in);
+      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+    }
 #endif
 
@@ -669,4 +680,5 @@
   read_mode = SH_SECTION_NONE; /* reset b/o sighup reload */
 
+  SH_FREE(line_in);
   SL_RETURN( 0, _("sh_readconf_read"));
 }
Index: /trunk/src/sstrip.c
===================================================================
--- /trunk/src/sstrip.c	(revision 285)
+++ /trunk/src/sstrip.c	(revision 286)
@@ -216,5 +216,5 @@
     Elf32_Phdr   const   *phdr;
     unsigned long	size, n;
-    int			i;
+    unsigned int	i;
 
     /* Start by setting the size to include the ELF header and the
@@ -245,5 +245,5 @@
     Elf64_Phdr   const   *phdr;
     unsigned long  	  size, n;
-    int			  i;
+    unsigned int	  i;
 
     /* Start by setting the size to include the ELF header and the
@@ -308,5 +308,5 @@
 {
     Elf32_Phdr   *phdr;
-    int	 	  i;
+    unsigned int  i;
 
     /* If the section header table is gone, then remove all references
@@ -340,5 +340,5 @@
 {
     Elf64_Phdr   *phdr;
-    int	 	  i;
+    unsigned int  i;
 
     /* If the section header table is gone, then remove all references
Index: /trunk/test/testrun_2c.sh
===================================================================
--- /trunk/test/testrun_2c.sh	(revision 285)
+++ /trunk/test/testrun_2c.sh	(revision 286)
@@ -267,45 +267,45 @@
     cp ./yule ./yule.orig
 
-	${TOP_SRCDIR}/configure --quiet  $TRUST --enable-debug --enable-network=server  --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=${RCFILE}2  --with-log-file=${LOGFILE}2 --with-pid-file=$PW_DIR/.samhain_lock2 --with-html-file=${HTML}2 --with-state-dir=$PW_DIR --with-port=49778 --with-database=mysql
-	#
+    ${TOP_SRCDIR}/configure --quiet  $TRUST --enable-debug --enable-network=server  --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=${RCFILE}2  --with-log-file=${LOGFILE}2 --with-pid-file=$PW_DIR/.samhain_lock2 --with-html-file=${HTML}2 --with-state-dir=$PW_DIR --with-port=49778 --with-database=mysql
+    #
+    if test x$? = x0; then
+	[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
+	$MAKE  > /dev/null 2>>test_log
 	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
+	    [ -z "$verbose" ] || log_msg_ok "make..."; 
 	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	cp yule yule.2 || return 1
-	#
+	    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
+	    return 1
+	fi
+
+    else
+	[ -z "$quiet" ] &&       log_msg_fail "configure...";
+	return 1
+    fi
+    
+    cp yule yule.2 || return 1
+    #
     cp ./yule.orig ./yule
-        #
-	SHPW=`cat ./testpw`
-
-	if test x"$SHPW" = x; then
-	    [ -z "$quiet" ]   && log_msg_fail  "password not generated -- aborting"
-	    return 1
-	fi
-
-	rm -f ./testpw
-
-	./samhain_setpwd yule new $SHPW >/dev/null
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd yule new $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd yule new $SHPW";
-	    return 1
-	fi
-
-
-        $MAKE clean >/dev/null || return 1
+    #
+    SHPW=`cat ./testpw`
+    
+    if test x"$SHPW" = x; then
+	[ -z "$quiet" ]   && log_msg_fail  "password not generated -- aborting"
+	return 1
+    fi
+    
+    rm -f ./testpw
+    
+    ./samhain_setpwd yule new $SHPW >/dev/null
+    
+    if test x$? = x0; then
+	[ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd yule new $SHPW";
+    else
+	[ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd yule new $SHPW";
+	return 1
+    fi
+
+
+    $MAKE clean >/dev/null || return 1
     mv yule.new yule || return 1
     #
