Index: trunk/src/sh_readconf.c
===================================================================
--- trunk/src/sh_readconf.c	(revision 20)
+++ trunk/src/sh_readconf.c	(revision 22)
@@ -52,5 +52,5 @@
 #endif
 
-extern int set_reverse_lookup (char * c);
+extern int set_reverse_lookup (const char * c);
 
 #undef  FIL__
@@ -282,6 +282,7 @@
   /* The system type, release, and machine.
    */
-  sprintf(myident, _("%s:%s:%s"),                  /* known to fit  */
-	  sh.host.system, sh.host.release, sh.host.machine);
+  sl_snprintf(myident, sizeof(myident), _("%s:%s:%s"),  
+	      sh.host.system, /* flawfinder: ignore */ 
+	      sh.host.release, sh.host.machine);
 
 
@@ -580,5 +581,5 @@
 }
 
-int sh_readconf_set_path (char * which, char * what)
+int sh_readconf_set_path (char * which, const char * what)
 {
   int len;
@@ -621,15 +622,15 @@
 }
 
-int sh_readconf_set_database_path (char * what)
+int sh_readconf_set_database_path (const char * what)
 {
   return (sh_readconf_set_path(sh.data.path, what));
 }
 
-int sh_readconf_set_logfile_path (char * what)
+int sh_readconf_set_logfile_path (const char * what)
 {
   return (sh_readconf_set_path(sh.srvlog.name, what));
 }
 
-int sh_readconf_set_lockfile_path (char * what)
+int sh_readconf_set_lockfile_path (const char * what)
 {
   return( sh_readconf_set_path(sh.srvlog.alt, what));
@@ -645,5 +646,5 @@
  
     
-int sh_readconf_setTime (char * str, ShTimerItem what)
+int sh_readconf_setTime (const char * str, ShTimerItem what)
 {
   unsigned long i = atoi (str);
@@ -674,15 +675,15 @@
 }
 
-int sh_readconf_setMailtime (char * c)
+int sh_readconf_setMailtime (const char * c)
 {
   return sh_readconf_setTime (c, SET_MAILTIME);
 }
 
-int sh_readconf_setFiletime (char * c)
+int sh_readconf_setFiletime (const char * c)
 {
   return sh_readconf_setTime (c, SET_FILETIME);
 }
 
-int sh_readconf_set_nice (char * c)
+int sh_readconf_set_nice (const char * c)
 {
   long val;
@@ -704,5 +705,5 @@
 
 #ifdef FANCY_LIBCAP
-int sh_readconf_setCaps(char * c)
+int sh_readconf_setCaps(const char * c)
 {
   int i;
@@ -718,79 +719,17 @@
   ShSectionType   section;
   ShSectionType   alt_section;
-  int (*func)(char * opt);
+  int (*func)(const char * opt);
 } cfg_options;
 
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-extern int sh_set_schedule_one(char * str);
-extern int sh_set_schedule_two(char * str);
+extern int sh_set_schedule_one(const char * str);
+extern int sh_set_schedule_two(const char * str);
 #endif
 #if defined (SH_WITH_SERVER)
-extern int sh_socket_use (char * c);
-extern int sh_socket_uid (char * c);
-extern int sh_socket_password (char * c);
-#endif
-
-/* Yes, this isn't very elegant ;)
- */
-#if defined(WITH_EXTERNAL)
-int sh_error_set_external_wrap (char * str) { 
-  return sh_error_set_external ((const char *) str);
-}
-#endif
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-int sh_files_setrecursion_wrap (char * str) { 
-  return sh_files_setrecursion ((const char *) str);
-}
-int sh_util_setchecksum_wrap (char * str) { 
-  return sh_util_setchecksum ((const char *) str);
-}
-#endif
-int sh_util_setlooptime_wrap (char * str) { 
-  return sh_util_setlooptime ((const char *) str);
-}
-#ifdef SH_WITH_MAIL
-int sh_error_setseverity_wrap (char * str) { 
-  return sh_error_setseverity ((const char *) str);
-}
-#endif
-int sh_calls_set_bind_addr_wrap (char * str) { 
-  return sh_calls_set_bind_addr ((const char *) str);
-}
-int sh_unix_setdeamon_wrap (char * str) { 
-  return sh_unix_setdeamon ((const char *) str);
-}
-int sh_error_setprint_wrap (char * str) { 
-  return sh_error_setprint ((const char *) str);
-}
-int sh_error_setlog_wrap (char * str) { 
-  return sh_error_setlog ((const char *) str);
-}
-int sh_error_set_syslog_wrap (char * str) { 
-  return sh_error_set_syslog ((const char *) str);
-}
-#ifdef HAVE_LIBPRELUDE
-int sh_error_set_prelude_wrap (char * str) { 
-  return sh_error_set_prelude ((const char *) str);
-}
-#endif
-#ifdef SH_WITH_CLIENT
-int sh_error_setexport_wrap (char * str) { 
-  return sh_error_setexport ((const char *) str);
-}
-#endif
-#ifdef SH_WITH_SERVER
-int sh_forward_set_strip_wrap (char * str) { 
-  return sh_forward_set_strip ((const char *) str);
-}
-int sh_unix_set_chroot_wrap (char * str) { 
-  return sh_unix_set_chroot ((const char *) str);
-}
-#endif
-#if defined(WITH_DATABASE)
-int sh_error_set_database_wrap (char * str) { 
-  return sh_error_set_database ((const char *) str);
-}
-#endif
- 
+extern int sh_socket_use (const char * c);
+extern int sh_socket_uid (const char * c);
+extern int sh_socket_password (const char * c);
+#endif
+
 cfg_options ext_table[] = {
 #if defined(WITH_EXTERNAL)
@@ -818,5 +757,5 @@
     sh_ext_add_or },
   { N_("externalseverity"),SH_SECTION_LOG,      SH_SECTION_EXTERNAL,  
-    sh_error_set_external_wrap },
+    sh_error_set_external },
   { N_("externalclass"),   SH_SECTION_LOG,      SH_SECTION_EXTERNAL,  
     sh_error_external_mask },
@@ -845,4 +784,5 @@
     set_enter_wrapper },
 #endif
+
 
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
@@ -902,7 +842,7 @@
     sh_util_obscure_ok },
   { N_("setrecursionlevel"),  SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_files_setrecursion_wrap },
+    sh_files_setrecursion },
   { N_("checksumtest"),       SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_util_setchecksum_wrap },
+    sh_util_setchecksum },
   { N_("reportonlyonce"),     SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_files_reportonce },
@@ -961,4 +901,5 @@
   { N_("setprelinkchecksum"),   SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_prelink_set_hash },
+
   /* client or standalone
    */
@@ -977,9 +918,9 @@
     sh_socket_password },
   { N_("setstripdomain"),      SH_SECTION_SRV,  SH_SECTION_MISC, 
-    sh_forward_set_strip_wrap },
+    sh_forward_set_strip },
   { N_("useseparatelogs"),     SH_SECTION_SRV,  SH_SECTION_MISC, 
     set_flag_sep_log },
   { N_("setchrootdir"),        SH_SECTION_SRV,  SH_SECTION_MISC, 
-    sh_unix_set_chroot_wrap },
+    sh_unix_set_chroot },
   { N_("setclienttimelimit"),  SH_SECTION_SRV,  SH_SECTION_MISC, 
     sh_forward_set_time_limit },
@@ -1002,5 +943,5 @@
 #ifdef SH_WITH_CLIENT
   { N_("exportseverity"),      SH_SECTION_LOG,  SH_SECTION_NONE, 
-    sh_error_setexport_wrap },
+    sh_error_setexport },
   { N_("exportclass"),         SH_SECTION_LOG,  SH_SECTION_NONE, 
     sh_error_export_mask },
@@ -1011,9 +952,9 @@
     sh_readconf_setFiletime },
   { N_("setlooptime"),     SH_SECTION_MISC,  SH_SECTION_NONE, 
-    sh_util_setlooptime_wrap },
+    sh_util_setlooptime },
 
 #ifdef SH_WITH_MAIL
   { N_("mailseverity"),      SH_SECTION_LOG,   SH_SECTION_NONE, 
-    sh_error_setseverity_wrap },
+    sh_error_setseverity },
   { N_("mailclass"),         SH_SECTION_LOG,   SH_SECTION_NONE, 
     sh_error_mail_mask },
@@ -1040,7 +981,7 @@
 #endif
   { N_("setbindaddress"),    SH_SECTION_MISC,  SH_SECTION_NONE,
-    sh_calls_set_bind_addr_wrap },
+    sh_calls_set_bind_addr },
   { N_("daemon"),            SH_SECTION_MISC,  SH_SECTION_NONE, 
-    sh_unix_setdeamon_wrap },
+    sh_unix_setdeamon },
   { N_("samhainpath"),       SH_SECTION_MISC,  SH_SECTION_NONE, 
     sh_unix_self_hash },
@@ -1051,20 +992,20 @@
 
   { N_("printseverity"),     SH_SECTION_LOG,   SH_SECTION_NONE, 
-    sh_error_setprint_wrap },
+    sh_error_setprint },
   { N_("printclass"),        SH_SECTION_LOG,   SH_SECTION_NONE, 
     sh_error_print_mask },
 
   { N_("logseverity"),       SH_SECTION_LOG,   SH_SECTION_NONE, 
-    sh_error_setlog_wrap },
+    sh_error_setlog },
   { N_("logclass"),          SH_SECTION_LOG,   SH_SECTION_NONE, 
     sh_error_log_mask },
 
   { N_("syslogseverity"),    SH_SECTION_LOG,   SH_SECTION_NONE, 
-    sh_error_set_syslog_wrap },
+    sh_error_set_syslog },
   { N_("syslogclass"),       SH_SECTION_LOG,   SH_SECTION_NONE, 
     sh_error_syslog_mask },
 #ifdef HAVE_LIBPRELUDE
   { N_("preludeseverity"),   SH_SECTION_LOG,   SH_SECTION_NONE, 
-    sh_error_set_prelude_wrap },
+    sh_error_set_prelude },
   { N_("preludeclass"),      SH_SECTION_LOG,   SH_SECTION_NONE, 
     sh_error_prelude_mask },
