Index: trunk/include/samhain.h
===================================================================
--- trunk/include/samhain.h	(revision 20)
+++ trunk/include/samhain.h	(revision 22)
@@ -290,4 +290,20 @@
 /*@null@*/ extern sh_key_t  *skey; 
 
+/**************************************************
+ *
+ * macros
+ *
+ **************************************************/
+
+/* signal-safe log function
+ */
+int safe_logger (int signal, int method, char * details);
+int safe_fatal  (int signal, int method, char * details, char *f, int l);
+
+#define SH_VAL_EQ(a,b) \
+     do { \
+         if ((a) != (b)) safe_fatal(0, 0, #a " != " #b, FIL__, __LINE__);\
+     } while (0)
+
 
 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
Index: trunk/include/sh_calls.h
===================================================================
--- trunk/include/sh_calls.h	(revision 20)
+++ trunk/include/sh_calls.h	(revision 22)
@@ -33,5 +33,5 @@
 /* Set aud functions
  */
-int sh_aud_set_functions(char * str_s);
+int sh_aud_set_functions(const char * str_s);
 
 
Index: trunk/include/sh_database.h
===================================================================
--- trunk/include/sh_database.h	(revision 20)
+++ trunk/include/sh_database.h	(revision 22)
@@ -5,12 +5,12 @@
 int sh_database_insert (char * message);
 
-int sh_database_use_persistent (char * str);
+int sh_database_use_persistent (const char * str);
 
-int sh_database_set_database (char * str);
-int sh_database_set_table (char * str);
-int sh_database_set_host (char * str);
-int sh_database_set_user (char * str);
-int sh_database_set_password (char * str);
-int sh_database_add_to_hash  (char * str);
-int set_enter_wrapper (char * str);
+int sh_database_set_database (const char * str);
+int sh_database_set_table (const char * str);
+int sh_database_set_host (const char * str);
+int sh_database_set_user (const char * str);
+int sh_database_set_password (const char * str);
+int sh_database_add_to_hash  (const char * str);
+int set_enter_wrapper (const char * str);
 #endif
Index: trunk/include/sh_error.h
===================================================================
--- trunk/include/sh_error.h	(revision 20)
+++ trunk/include/sh_error.h	(revision 22)
@@ -81,12 +81,12 @@
 /* set mask for message class
  */
-int sh_error_log_mask (char * c);
-int sh_error_print_mask (char * c);
-int sh_error_mail_mask (char * c);
-int sh_error_export_mask (char * c);
-int sh_error_syslog_mask (char * c);
-int sh_error_external_mask (char * c);
-int sh_error_database_mask (char * c);
-int sh_error_prelude_mask (char * c);
+int sh_error_log_mask (const char * c);
+int sh_error_print_mask (const char * c);
+int sh_error_mail_mask (const char * c);
+int sh_error_export_mask (const char * c);
+int sh_error_syslog_mask (const char * c);
+int sh_error_external_mask (const char * c);
+int sh_error_database_mask (const char * c);
+int sh_error_prelude_mask (const char * c);
 
 
@@ -99,5 +99,5 @@
 #ifdef SH_WITH_SERVER
 void sh_error_set_peer(const char * str);
-int  set_flag_sep_log (char * str);
+int  set_flag_sep_log (const char * str);
 #endif
 
@@ -108,5 +108,5 @@
 /* convert a string to a numeric priority
  */ 
-int sh_error_convert_level (char * str_s);
+int sh_error_convert_level (const char * str_s);
 
 /* only to stderr (GOOD/BAD)
@@ -116,9 +116,9 @@
 /* set syslog facility 
  */
-int  sh_log_set_facility (char * c);
+int  sh_log_set_facility (const char * c);
 
 /* define message header
  */
-int sh_error_ehead (/*@null@*/char * s);
+int sh_error_ehead (/*@null@*/const char * s);
 
 /* set level for error logging 
@@ -128,5 +128,5 @@
 /* set severity levels
  */
-int sh_error_set_iv (int iv, char *  severity_s);
+int sh_error_set_iv (int iv, const char *  severity_s);
 
 /* set priorities
@@ -178,5 +178,5 @@
 /* (re)set the console device(s)
  */
-int sh_log_set_console (char * address);
+int sh_log_set_console (const char * address);
 void reset_count_dev_console(void);
 
@@ -188,5 +188,5 @@
 /* enable message queue
  */
-int enable_msgq(char * foo);
+int enable_msgq(const char * foo);
 #endif
  
Index: trunk/include/sh_extern.h
===================================================================
--- trunk/include/sh_extern.h	(revision 20)
+++ trunk/include/sh_extern.h	(revision 22)
@@ -43,5 +43,5 @@
  * -- add CL argument, return # of arguments
  */
-int sh_ext_tas_add_argv(sh_tas_t * tas, char * val);
+int sh_ext_tas_add_argv(sh_tas_t * tas, const char * val);
 /*
  * -- remove last CL argument
@@ -51,9 +51,9 @@
  * -- add environment variable, return # of variables
  */
-int sh_ext_tas_add_envv(sh_tas_t * tas, char * key, char * val);
+int sh_ext_tas_add_envv(sh_tas_t * tas, const char * key, const char * val);
 /*
  * -- set command
  */
-void sh_ext_tas_command(sh_tas_t * tas, char * command);
+void sh_ext_tas_command(sh_tas_t * tas, const char * command);
 /*
  * -- initialize task structure
@@ -71,5 +71,5 @@
  * -- start a new external command, and add it to the list
  */ 
-int sh_ext_setcommand(char * cmd);
+int sh_ext_setcommand(const char * cmd);
 
 /* 
@@ -81,50 +81,50 @@
  * -- set deadtime
  */
-int sh_ext_deadtime (char * str);
+int sh_ext_deadtime (const char * str);
 
 /*
  * -- add keywords to the OR filter
  */
-int sh_ext_add_or (char * str);
+int sh_ext_add_or (const char * str);
 
 /*
  * -- add keywords to the AND filter
  */
-int sh_ext_add_and (char * str);
+int sh_ext_add_and (const char * str);
 
 /*
  * -- add keywords to the NOT filter
  */
-int sh_ext_add_not (char * str);
+int sh_ext_add_not (const char * str);
 
 /*
  * -- add keywords to the CL argument list
  */
-int sh_ext_add_argv (char * str);
+int sh_ext_add_argv (const char * str);
 
 /*
  * -- add a path to the environment
  */
-int sh_ext_add_default (char * str);
+int sh_ext_add_default (const char * str);
 
 /*
  * -- add an environment variable
  */
-int sh_ext_add_environ (char * str);
+int sh_ext_add_environ (const char * str);
 
 /*
  * -- define type
  */
-int sh_ext_type (char * str);
+int sh_ext_type (const char * str);
 
 /*
  * -- define checksum
  */
-int sh_ext_checksum (char * str);
+int sh_ext_checksum (const char * str);
 
 /*
  * -- choose privileges
  */
-int sh_ext_priv (char * c);
+int sh_ext_priv (const char * c);
 
 /*
Index: trunk/include/sh_files.h
===================================================================
--- trunk/include/sh_files.h	(revision 20)
+++ trunk/include/sh_files.h	(revision 22)
@@ -23,5 +23,5 @@
 /* register exceptions to hardlink check
  */
-int sh_files_hle_reg (char * str);
+int sh_files_hle_reg (const char * str);
 
 /* check the setup
@@ -35,5 +35,5 @@
 /* activate hardlink check
  */
-int sh_files_check_hardlinks (char * opt);
+int sh_files_check_hardlinks (const char * opt);
 
 /* set recursion depth
@@ -43,9 +43,9 @@
 /* report only once
  */
-int sh_files_reportonce(char * c);
+int sh_files_reportonce(const char * c);
 
 /* report full details
  */
-int sh_files_fulldetail(char * c);
+int sh_files_fulldetail(const char * c);
 
 /* reset the 'checked' flag
@@ -67,74 +67,74 @@
 /* push a directory on the stack USER0
  */
-int  sh_files_pushdir_user0 (char * dirName);
+int  sh_files_pushdir_user0 (const char * dirName);
 
 /* push a directory on the stack USER1
  */
-int  sh_files_pushdir_user1 (char * dirName);
+int  sh_files_pushdir_user1 (const char * dirName);
 
 /* push a directory on the stack PRELINK
  */
-int  sh_files_pushdir_prelink (char * dirName);
+int  sh_files_pushdir_prelink (const char * dirName);
 
 /* push a directory on the stack ATTR
  */
-int  sh_files_pushdir_attr (char * dirName);
+int  sh_files_pushdir_attr (const char * dirName);
 
 /* push a directory on the stack READONLY
  */
-int  sh_files_pushdir_ro (char * dirName);
+int  sh_files_pushdir_ro (const char * dirName);
 
 /* push a directory on the stack LOGFILE
  */
-int  sh_files_pushdir_log (char * dirName);
+int  sh_files_pushdir_log (const char * dirName);
 
 /* push a directory on the stack GROWING LOGFILE
  */
-int  sh_files_pushdir_glog (char * dirName);
+int  sh_files_pushdir_glog (const char * dirName);
 
 /* push a directory on the stack IGNORE NONE
  */
-int  sh_files_pushdir_noig (char * dirName);
+int  sh_files_pushdir_noig (const char * dirName);
 
 /* push a directory on the stack IGNORE ALL 
  */
-int  sh_files_pushdir_allig (char * dirName);
+int  sh_files_pushdir_allig (const char * dirName);
 
 
 /* push a file on the stack USER0
  */
-int  sh_files_pushfile_user0 (char * dirName);
+int  sh_files_pushfile_user0 (const char * dirName);
 
 /* push a file on the stack USER1
  */
-int  sh_files_pushfile_user1 (char * dirName);
+int  sh_files_pushfile_user1 (const char * dirName);
 
 /* push a file on the stack PRELINK
  */
-int  sh_files_pushfile_prelink (char * dirName);
+int  sh_files_pushfile_prelink (const char * dirName);
 
 /* push a file on the stack ATTR
  */
-int  sh_files_pushfile_attr (char * dirName);
+int  sh_files_pushfile_attr (const char * dirName);
 
 /* push a file on the stack READONLY
  */
-int  sh_files_pushfile_ro (char * dirName);
+int  sh_files_pushfile_ro (const char * dirName);
 
 /* push a file on the stack LOGFILE
  */
-int  sh_files_pushfile_log (char * dirName);
+int  sh_files_pushfile_log (const char * dirName);
 
 /* push a file on the stack GROWING LOGFILE
  */
-int  sh_files_pushfile_glog (char * dirName);
+int  sh_files_pushfile_glog (const char * dirName);
 
 /* push a file on the stack IGNORE NONE
  */
-int  sh_files_pushfile_noig (char * dirName);
+int  sh_files_pushfile_noig (const char * dirName);
 
 /* push a file on the stack IGNORE ALL
  */
-int  sh_files_pushfile_allig (char * dirName);
+int  sh_files_pushfile_allig (const char * dirName);
 
 
@@ -153,13 +153,13 @@
 /* redefine policies
  */
-int sh_files_redef_user0(char * str);
-int sh_files_redef_user1(char * str);
-int sh_files_redef_prelink(char * str);
-int sh_files_redef_readonly(char * str);
-int sh_files_redef_loggrow(char * str);
-int sh_files_redef_logfiles(char * str);
-int sh_files_redef_attributes(char * str);
-int sh_files_redef_noignore(char * str);
-int sh_files_redef_allignore(char * str);
+int sh_files_redef_user0(const char * str);
+int sh_files_redef_user1(const char * str);
+int sh_files_redef_prelink(const char * str);
+int sh_files_redef_readonly(const char * str);
+int sh_files_redef_loggrow(const char * str);
+int sh_files_redef_logfiles(const char * str);
+int sh_files_redef_attributes(const char * str);
+int sh_files_redef_noignore(const char * str);
+int sh_files_redef_allignore(const char * str);
 
 
Index: trunk/include/sh_forward.h
===================================================================
--- trunk/include/sh_forward.h	(revision 20)
+++ trunk/include/sh_forward.h	(revision 22)
@@ -32,9 +32,9 @@
 /* set time limit
  */
-int sh_forward_set_time_limit(char * str);
+int sh_forward_set_time_limit(const char * str);
 
 /* error level for lookup failure
  */
-int sh_forward_lookup_level (char * c);
+int sh_forward_lookup_level (const char * c);
 
 /* create client entry for given password
@@ -45,5 +45,5 @@
 
 #ifdef INET_SYSLOG
-int set_syslog_active(char * c);
+int set_syslog_active(const char * c);
 #endif
 
@@ -55,21 +55,21 @@
  * and set by accept()
  */
-int set_socket_peer (char * c);
+int set_socket_peer (const char * c);
 
 /* whether to use client severity
  */
-int sh_forward_use_clt_sev (char * c);
+int sh_forward_use_clt_sev (const char * c);
 
 /* whether to use client class
  */
-int sh_forward_use_clt_class (char * c);
+int sh_forward_use_clt_class (const char * c);
 
 /* server port
  */
-int sh_forward_set_port(char * c);
+int sh_forward_set_port(const char * c);
 
 /* server interface
  */
-int sh_forward_set_interface(char * c);
+int sh_forward_set_interface(const char * c);
 
 /* a wrapper function
@@ -79,5 +79,5 @@
 /* register a client
  */
-int sh_forward_register_client (char * str);
+int sh_forward_register_client (const char * str);
 
 /* start server
@@ -103,5 +103,5 @@
 /* set log server
  */
-int sh_forward_setlogserver (char * address);
+int sh_forward_setlogserver (const char * address);
 void reset_count_dev_server(void);
 
Index: trunk/include/sh_hash.h
===================================================================
--- trunk/include/sh_hash.h	(revision 20)
+++ trunk/include/sh_hash.h	(revision 22)
@@ -42,5 +42,5 @@
 /* version string for database
  */
-int sh_hash_version_string(char * str);
+int sh_hash_version_string(const char * str);
 
 /* List database content
Index: trunk/include/sh_ignore.h
===================================================================
--- trunk/include/sh_ignore.h	(revision 20)
+++ trunk/include/sh_ignore.h	(revision 22)
@@ -2,6 +2,6 @@
 #define SH_IGNORE_H
 
-int sh_ignore_add_del (char * addpath);
-int sh_ignore_add_new (char * addpath);
+int sh_ignore_add_del (const char * addpath);
+int sh_ignore_add_new (const char * addpath);
 
 int sh_ignore_chk_del (const char * chkpath);
Index: trunk/include/sh_mail.h
===================================================================
--- trunk/include/sh_mail.h	(revision 20)
+++ trunk/include/sh_mail.h	(revision 22)
@@ -26,13 +26,13 @@
 /* set a relay server
  */
-int sh_mail_set_relay (char * str_s);
+int sh_mail_set_relay (const char * str_s);
 
 /* send to all recpts. in one mail
  */
-int sh_mail_setFlag (char * str);
+int sh_mail_setFlag (const char * str);
 
 /* set the subject string 
  */
-int set_mail_subject (char * str);
+int set_mail_subject (const char * str);
 
 /* test mailbox
@@ -44,9 +44,9 @@
 #define SH_MAX_FAIL    48
 
-int sh_mail_setNum (char * str);
+int sh_mail_setNum (const char * str);
 
-int sh_mail_setaddress (char * address);
+int sh_mail_setaddress (const char * address);
 void reset_count_dev_mail(void);
-int sh_mail_setaddress_int (char * address);
+int sh_mail_setaddress_int (const char * address);
 
 /* call if not urgent
@@ -60,9 +60,9 @@
 /* set sender of mail
  */
-int sh_mail_set_sender (char *str);
+int sh_mail_set_sender (const char *str);
 
-int sh_mail_add_or  (char * str);
-int sh_mail_add_and (char * str);
-int sh_mail_add_not (char * str);
+int sh_mail_add_or  (const char * str);
+int sh_mail_add_and (const char * str);
+int sh_mail_add_not (const char * str);
 
 #endif
Index: trunk/include/sh_prelink.h
===================================================================
--- trunk/include/sh_prelink.h	(revision 20)
+++ trunk/include/sh_prelink.h	(revision 22)
@@ -14,5 +14,5 @@
 /* configuration
  */
-int sh_prelink_set_path (char * str);
-int sh_prelink_set_hash (char * str);
+int sh_prelink_set_path (const char * str);
+int sh_prelink_set_hash (const char * str);
 #endif
Index: trunk/include/sh_prelude.h
===================================================================
--- trunk/include/sh_prelude.h	(revision 20)
+++ trunk/include/sh_prelude.h	(revision 22)
@@ -6,5 +6,5 @@
 int  sh_prelude_init();
 
-int sh_prelude_set_profile(char *arg);
+int sh_prelude_set_profile(const char *arg);
 
 int sh_prelude_alert (int priority, int class, char * message,
@@ -13,8 +13,8 @@
 /* map severity levels
  */
-int sh_prelude_map_info (char * str);
-int sh_prelude_map_low (char * str);
-int sh_prelude_map_medium (char * str);
-int sh_prelude_map_high (char * str);
+int sh_prelude_map_info (const char * str);
+int sh_prelude_map_low (const char * str);
+int sh_prelude_map_medium (const char * str);
+int sh_prelude_map_high (const char * str);
 
 #endif
Index: trunk/include/sh_tiger.h
===================================================================
--- trunk/include/sh_tiger.h	(revision 20)
+++ trunk/include/sh_tiger.h	(revision 22)
@@ -22,5 +22,5 @@
 /* NEW Thu Oct 18 19:59:08 CEST 2001
  */
-int sh_tiger_hashtype (char * c);
+int sh_tiger_hashtype (const char * c);
 char * sh_tiger_generic_hash (char * filename, TigerType what, 
 			      UINT64 Length, int timeout);
Index: trunk/include/sh_unix.h
===================================================================
--- trunk/include/sh_unix.h	(revision 20)
+++ trunk/include/sh_unix.h	(revision 22)
@@ -148,9 +148,9 @@
 /* whether to use localtime for file timesatams in logs
  */
-int sh_unix_uselocaltime (char * c);
+int sh_unix_uselocaltime (const char * c);
 
 /* set I/O limit
  */
-int  sh_unix_set_io_limit (char * c);
+int  sh_unix_set_io_limit (const char * c);
 void sh_unix_io_pause ();
 
@@ -199,5 +199,5 @@
 /* checksum of own binary
  */
-int sh_unix_self_hash (char * c);
+int sh_unix_self_hash (const char * c);
 
 /* return BAD on failure
@@ -207,5 +207,5 @@
 /* add a trusted user to the list 
  */
-int tf_add_trusted_user(char *);
+int tf_add_trusted_user(const char *);
 
 /* check a file 
@@ -224,5 +224,5 @@
 /* set the timeserver address
  */
-int sh_unix_settimeserver (char * address);
+int sh_unix_settimeserver (const char * address);
 void reset_count_dev_time(void);
 
Index: trunk/include/sh_utils.h
===================================================================
--- trunk/include/sh_utils.h	(revision 20)
+++ trunk/include/sh_utils.h	(revision 22)
@@ -65,5 +65,5 @@
 /* set signature type HASH-TIGER/HMAC-TIGER
  */
-int sh_util_sigtype (char * c);
+int sh_util_sigtype (const char * c);
 
 /* compute a signature
@@ -83,9 +83,9 @@
 /* don't log output files
  */
-int sh_util_hidesetup(char * c);
+int sh_util_hidesetup(const char * c);
 
 /* exceptions to obscure name check
  */
-int sh_util_obscure_ok (char * str);
+int sh_util_obscure_ok (const char * str);
 
 /* read a hexchar
