Index: trunk/src/sh_files.c
===================================================================
--- trunk/src/sh_files.c	(revision 20)
+++ trunk/src/sh_files.c	(revision 22)
@@ -72,10 +72,8 @@
 #define FIL__  _("sh_files.c")
 
-extern int safe_logger (int signal, int method, pid_t thepid);
-
 extern int flag_err_debug;
 extern int flag_err_info;
 
-int sh_files_reportonce(char * c)
+int sh_files_reportonce(const char * c)
 {
   int i;
@@ -86,5 +84,5 @@
 }
     
-int sh_files_fulldetail(char * c)
+int sh_files_fulldetail(const char * c)
 {
   int i;
@@ -156,6 +154,6 @@
 static int        sh_files_fullpath  (char * testdir, char * d_name, 
 				      char * statpath);
-static int        sh_files_pushdir   (int class, char * str_s);
-static int        sh_files_pushfile  (int class, char * str_s);
+static int        sh_files_pushdir   (int class, const char * str_s);
+static int        sh_files_pushfile  (int class, const char * str_s);
 static int        sh_files_checkdir  (int class, int rdepth, char * dirName,
 				      char * relativeName);
@@ -446,10 +444,10 @@
 
 
-int sh_files_pushfile_prelink (char * str_s)
+int sh_files_pushfile_prelink (const char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_PRELINK, str_s));
 }
 
-int sh_files_pushfile_user0 (char * str_s)
+int sh_files_pushfile_user0 (const char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_USER0, str_s));
@@ -457,5 +455,5 @@
 
 
-int sh_files_pushfile_user1 (char * str_s)
+int sh_files_pushfile_user1 (const char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_USER1, str_s));
@@ -463,30 +461,30 @@
 
 
-int sh_files_pushfile_ro (char * str_s)
+int sh_files_pushfile_ro (const char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_READONLY, str_s));
 }
 
-int sh_files_pushfile_attr (char * str_s)
+int sh_files_pushfile_attr (const char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_ATTRIBUTES, str_s));
 }
 
-int sh_files_pushfile_log (char * str_s)
+int sh_files_pushfile_log (const char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_LOGFILES, str_s));
 }
 
-int sh_files_pushfile_glog (char * str_s)
+int sh_files_pushfile_glog (const char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_LOGGROW, str_s));
 }
 
-int sh_files_pushfile_noig (char * str_s)
+int sh_files_pushfile_noig (const char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_NOIGNORE, str_s));
 }
 
-int sh_files_pushfile_allig (char * str_s)
+int sh_files_pushfile_allig (const char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_ALLIGNORE, str_s));
@@ -511,5 +509,5 @@
 /* set mask(class)
  */
-static int sh_files_parse_mask (unsigned long * mask, char * str)
+static int sh_files_parse_mask (unsigned long * mask, const char * str)
 {
   int l, i = 0, act = 0, k = 0;
@@ -602,37 +600,37 @@
 }
 
-int sh_files_redef_prelink(char * str)
+int sh_files_redef_prelink(const char * str)
 {
   return (sh_files_parse_mask(&mask_PRELINK, str));
 } 
-int sh_files_redef_user0(char * str)
+int sh_files_redef_user0(const char * str)
 {
   return (sh_files_parse_mask(&mask_USER0, str));
 } 
-int sh_files_redef_user1(char * str)
+int sh_files_redef_user1(const char * str)
 {
   return (sh_files_parse_mask(&mask_USER1, str));
 } 
-int sh_files_redef_readonly(char * str)
+int sh_files_redef_readonly(const char * str)
 {
   return (sh_files_parse_mask(&mask_READONLY, str));
 } 
-int sh_files_redef_loggrow(char * str)
+int sh_files_redef_loggrow(const char * str)
 {
   return (sh_files_parse_mask(&mask_LOGGROW, str));
 } 
-int sh_files_redef_logfiles(char * str)
+int sh_files_redef_logfiles(const char * str)
 {
   return (sh_files_parse_mask(&mask_LOGFILES, str));
 } 
-int sh_files_redef_attributes(char * str)
+int sh_files_redef_attributes(const char * str)
 {
   return (sh_files_parse_mask(&mask_ATTRIBUTES, str));
 } 
-int sh_files_redef_noignore(char * str)
+int sh_files_redef_noignore(const char * str)
 {
   return (sh_files_parse_mask(&mask_NOIGNORE, str));
 } 
-int sh_files_redef_allignore(char * str)
+int sh_files_redef_allignore(const char * str)
 {
   return (sh_files_parse_mask(&mask_ALLIGNORE, str));
@@ -725,5 +723,5 @@
       if (zfileList == NULL) 
 	{
-	  (void) safe_logger (0, 0, getpid());
+	  (void) safe_logger (0, 0, NULL);
 	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
 	}
@@ -734,5 +732,5 @@
   if (-1 == ret)
     {
-      (void) safe_logger (0, 0, getpid());
+      (void) safe_logger (0, 0, NULL);
       aud__exit(FIL__, __LINE__, EXIT_FAILURE);
     }
@@ -745,12 +743,13 @@
 
 
-static int sh_files_pushfile (int class, char * str_s)
-{
+static int sh_files_pushfile (int class, const char * str_s)
+{
+  int     len;
   char  * tmp;
-  int     len;
+  char  * p;
 #ifdef HAVE_GLOB_H
-  glob_t  pglob;
   int     globstatus = -1;
   unsigned int     gloop;
+  glob_t  pglob;
 #endif
 
@@ -808,7 +807,8 @@
        * special case of the root directory.
        */
-      if (str_s[len-1] == '/' && len > 1)
+      p = sh_util_strdup (str_s);
+      if (p[len-1] == '/' && len > 1)
 	{
-	  str_s[len-1] = '\0';
+	  p[len-1] = '\0';
 	  --len;
 	}
@@ -817,12 +817,12 @@
 
 #ifdef HAVE_GLOB_H
-  if (0 == sh_files_has_metachar(str_s))
-    {
-      sh_files_push_file_int (class, str_s, len);
+  if (0 == sh_files_has_metachar(p))
+    {
+      sh_files_push_file_int (class, p, len);
     }
   else
     {
       pglob.gl_offs = 0;
-      globstatus    = glob (str_s, 0, sh_files_globerr, &pglob);
+      globstatus    = glob (p, 0, sh_files_globerr, &pglob);
 
       if (globstatus == 0 && pglob.gl_pathc > 0)
@@ -834,5 +834,5 @@
       else
 	{
-	  tmp = sh_util_safe_name (str_s);
+	  tmp = sh_util_safe_name (p);
 
 	  if (pglob.gl_pathc == 0
@@ -869,7 +869,8 @@
 
 #else
-  sh_files_push_file_int (class, str_s, len);
-#endif
-
+  sh_files_push_file_int (class, p, len);
+#endif
+
+  SH_FREE(p);
   SL_RETURN((0),_("sh_files_pushfile"));
 }
@@ -1028,45 +1029,45 @@
 }
 
-int sh_files_pushdir_prelink (char * str_s)
+int sh_files_pushdir_prelink (const char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_PRELINK, str_s));
 }
 
-int sh_files_pushdir_user0 (char * str_s)
+int sh_files_pushdir_user0 (const char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_USER0, str_s));
 }
 
-int sh_files_pushdir_user1 (char * str_s)
+int sh_files_pushdir_user1 (const char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_USER1, str_s));
 }
 
-int sh_files_pushdir_attr (char * str_s)
+int sh_files_pushdir_attr (const char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_ATTRIBUTES, str_s));
 }
 
-int sh_files_pushdir_ro (char * str_s)
+int sh_files_pushdir_ro (const char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_READONLY, str_s));
 }
 
-int sh_files_pushdir_log (char * str_s)
+int sh_files_pushdir_log (const char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_LOGFILES, str_s));
 }
 
-int sh_files_pushdir_glog (char * str_s)
+int sh_files_pushdir_glog (const char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_LOGGROW, str_s));
 }
 
-int sh_files_pushdir_noig (char * str_s)
+int sh_files_pushdir_noig (const char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_NOIGNORE, str_s));
 }
 
-int sh_files_pushdir_allig (char * str_s)
+int sh_files_pushdir_allig (const char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_ALLIGNORE, str_s));
@@ -1120,5 +1121,5 @@
       if (tree == NULL) 
 	{
-	  (void) safe_logger (0, 0, getpid());
+	  (void) safe_logger (0, 0, NULL);
 	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
 	}
@@ -1133,5 +1134,5 @@
   if (-1 == ret)
     {
-      (void) safe_logger (0, 0, getpid());
+      (void) safe_logger (0, 0, NULL);
       aud__exit(FIL__, __LINE__, EXIT_FAILURE);
     }
@@ -1143,5 +1144,5 @@
 }
 
-static int sh_files_pushdir (int class, char * str_s)
+static int sh_files_pushdir (int class, const char * str_s)
 {
   char  * tmp;
@@ -1149,4 +1150,5 @@
   int     rdepth = 0;
   char  * tail = NULL;
+  char  * p;
 
 #ifdef HAVE_GLOB_H
@@ -1166,16 +1168,20 @@
     SL_RETURN((-1), _("sh_files_pushdir"));
   
-
-  if (str_s[0] != '/')
-    {
-      rdepth = strtol(str_s, &tail, 10);
-      if (tail == str_s)
-	SL_RETURN((-1), _("sh_files_pushdir"));
+  p = sh_util_strdup (str_s);
+
+  if (p[0] != '/')
+    {
+      rdepth = strtol(p, &tail, 10);
+      if (tail == p)
+	{
+	  SH_FREE(p);
+	  SL_RETURN((-1), _("sh_files_pushdir"));
+	}
     }
   else
-    tail   = str_s;
+    tail   = p;
   
 
-  if (rdepth < (-1) || tail == str_s || rdepth > 99)
+  if (rdepth < (-1) || tail == p || rdepth > 99)
     rdepth = (-2);
 
@@ -1188,8 +1194,10 @@
 		       tmp);
       SH_FREE(tmp);
+      SH_FREE(p);
       SL_RETURN((-1), _("sh_files_pushdir"));
     } 
   else if (len < 1) 
     {
+      SH_FREE(p);
       SL_RETURN((-1), _("sh_files_pushdir"));
     } 
@@ -1200,4 +1208,5 @@
 		       tmp);
       SH_FREE(tmp);
+      SH_FREE(p);
       SL_RETURN((-1), _("sh_files_pushdir"));
     } 
@@ -1268,4 +1277,5 @@
 #endif
 
+  SH_FREE(p);
   SL_RETURN((0), _("sh_files_pushdir"));
 }  
@@ -1322,5 +1332,5 @@
 /* Simply sets our boolean as to whether this check is active 
  */
-int sh_files_check_hardlinks (char * opt)
+int sh_files_check_hardlinks (const char * opt)
 {
   int i;
@@ -1338,5 +1348,5 @@
 static struct sh_hle_struct * sh_hl_exc = NULL;
 
-int sh_files_hle_reg (char * str)
+int sh_files_hle_reg (const char * str)
 {
   long   offset;
