Index: trunk/include/samhain.h
===================================================================
--- trunk/include/samhain.h	(revision 169)
+++ trunk/include/samhain.h	(revision 170)
@@ -42,6 +42,11 @@
 #define SH_MAXBUF      4096
 #define SH_PATHBUF      256
+#define SH_MSG_BUF    64512
 
 #define SH_ERRBUF_SIZE   64
+
+/* MAX_PATH_STORE must be >= KEY_LEN
+ */
+#define MAX_PATH_STORE 12287
 
 /* Sizes for arrays (user, group, timestamp).
@@ -384,6 +389,6 @@
 /* signal-safe log function
  */
-int  safe_logger (int signal, int method, char * details);
-void safe_fatal  (char * details, char *f, int l);
+int  safe_logger (int thesignal, int method, char * details);
+void safe_fatal  (const char * details, const char *f, int l);
 
 #define SH_VALIDATE_EQ(a,b) \
Index: trunk/include/sh_calls.h
===================================================================
--- trunk/include/sh_calls.h	(revision 169)
+++ trunk/include/sh_calls.h	(revision 170)
@@ -36,52 +36,52 @@
 
 
-long int retry_accept(char * file, int line, 
+long int retry_accept(const char * file, int line, 
 		      int fd, struct sockaddr *serv_addr, int * addrlen);
-long int retry_stat (char * file, int line, 
+long int retry_stat (const char * file, int line, 
 		     const char *file_name, struct stat *buf);
-long int retry_fstat(char * file, int line, 
+long int retry_fstat(const char * file, int line, 
 		     int filed,             struct stat *buf);
-long int retry_lstat(char * file, int line, 
+long int retry_lstat(const char * file, int line, 
 		     const char *file_name, struct stat *buf);
-long int retry_fcntl(char * file, int line, 
+long int retry_fcntl(const char * file, int line, 
 		     int fd, int cmd, long arg);
 
 long int retry_msleep (int sec, int millisec);
 
-long int retry_sigaction(char * file, int line, 
+long int retry_sigaction(const char * file, int line, 
 			 int signum,  const  struct  sigaction  *act,
 			 struct sigaction *oldact);
 
 int      sh_calls_set_bind_addr (const char *);
-long int retry_connect(char * file, int line,
+long int retry_connect(const char * file, int line,
 		       int fd, struct sockaddr *serv_addr, int addrlen);
 
-long int retry_aud_dup2    (char * file, int line, int fd, int fd2);
-long int retry_aud_execve  (char * file, int line, 
+long int retry_aud_dup2    (const char * file, int line, int fd, int fd2);
+long int retry_aud_execve  (const char * file, int line, 
 			    const  char *dateiname, char * argv[],
 			    char *envp[]);
-long int retry_aud_dup     (char * file, int line, 
+long int retry_aud_dup     (const char * file, int line, 
 			    int fd);
-long int retry_aud_chdir   (char * file, int line, 
+long int retry_aud_chdir   (const char * file, int line, 
 			    const char *path);
-long int retry_aud_unlink  (char * file, int line, 
+long int retry_aud_unlink  (const char * file, int line, 
 			    char * path);
-long int retry_aud_utime   (char * file, int line, 
+long int retry_aud_utime   (const char * file, int line, 
 			    char * path, struct utimbuf *buf);
 
-long int aud_open           (char * file, int line, int privs,
+long int aud_open           (const char * file, int line, int privs,
 			     const char *pathname, int flags, mode_t mode);
-long int aud_open_noatime   (char * file, int line, int privs,
+long int aud_open_noatime   (const char * file, int line, int privs,
 			     const char *pathname, int flags, mode_t mode,
 			     int * o_noatime);
 /*@noreturn@*/
-void     aud_exit   (char * file, int line, int fd);
+void     aud_exit   (const char * file, int line, int fd);
 /*@noreturn@*/
-void     aud__exit  (char * file, int line, int fd);
-pid_t    aud_fork   (char * file, int line);
-int      aud_pipe   (char * file, int line, int modus[2]);
-int      aud_setuid (char * file, int line, uid_t uid);
-int      aud_setgid (char * file, int line, gid_t gid);
-long int aud_kill   (char * file, int line, pid_t pid, int sig);
+void     aud__exit  (const char * file, int line, int fd);
+pid_t    aud_fork   (const char * file, int line);
+int      aud_pipe   (const char * file, int line, int modus[2]);
+int      aud_setuid (const char * file, int line, uid_t uid);
+int      aud_setgid (const char * file, int line, gid_t gid);
+long int aud_kill   (const char * file, int line, pid_t pid, int sig);
 
 #endif 
Index: trunk/include/sh_cat.h
===================================================================
--- trunk/include/sh_cat.h	(revision 169)
+++ trunk/include/sh_cat.h	(revision 170)
@@ -7,10 +7,10 @@
   unsigned long priority;
   unsigned long class;
-  char *        format;
+  const char *        format;
 } cat_entry;
 
 extern cat_entry msg_cat[];
 
-extern char * class_cat[];
+extern const char * class_cat[];
 
 #define  AUD      0
Index: trunk/include/sh_database.h
===================================================================
--- trunk/include/sh_database.h	(revision 169)
+++ trunk/include/sh_database.h	(revision 170)
@@ -2,5 +2,5 @@
 #define SH_DATABASE_H
 
-void sh_database_reset();
+void sh_database_reset(void);
 int sh_database_insert (char * message);
 
Index: trunk/include/sh_error.h
===================================================================
--- trunk/include/sh_error.h	(revision 169)
+++ trunk/include/sh_error.h	(revision 170)
@@ -107,5 +107,5 @@
 /* init or re-init log facilities that need it
  */
-void sh_error_fixup();
+void sh_error_fixup(void);
 
 /* convert a string to a numeric priority
Index: trunk/include/sh_error_min.h
===================================================================
--- trunk/include/sh_error_min.h	(revision 169)
+++ trunk/include/sh_error_min.h	(revision 170)
@@ -22,5 +22,5 @@
 /* this function should be called to report an error
  */
-void sh_error_handle (int flag, char * file, long line, 
+void sh_error_handle (int flag, const char * file, long line, 
 		      long errnum, unsigned long  msg_index, ...);
 
Index: trunk/include/sh_forward.h
===================================================================
--- trunk/include/sh_forward.h	(revision 169)
+++ trunk/include/sh_forward.h	(revision 170)
@@ -54,5 +54,5 @@
 /* create socket and start listening
  */
-void create_server_tcp_socket ();
+void create_server_tcp_socket (void);
 
 /* whether to use client address as known to the communication layer
Index: trunk/include/sh_gpg.h
===================================================================
--- trunk/include/sh_gpg.h	(revision 169)
+++ trunk/include/sh_gpg.h	(revision 170)
@@ -29,5 +29,5 @@
 /* log successful startup
  */
-void sh_gpg_log_startup ();
+void sh_gpg_log_startup (void);
 
 #endif
Index: trunk/include/sh_hash.h
===================================================================
--- trunk/include/sh_hash.h	(revision 169)
+++ trunk/include/sh_hash.h	(revision 170)
@@ -30,5 +30,5 @@
 /* format a uint64
  */
-char * sh_hash_size_format();
+char * sh_hash_size_format(void);
 
 /* report on a missing file
@@ -82,5 +82,5 @@
 /* reset sh_hash_pushdata to use 'update' in daemon mode
  */
-void sh_hash_pushdata_reset ();
+void sh_hash_pushdata_reset (void);
 
 /* Insert a file into the in-memory database.
@@ -145,4 +145,4 @@
 /* Write out database
  */
-int sh_hash_writeout();
+int sh_hash_writeout(void);
 #endif
Index: trunk/include/sh_ignore.h
===================================================================
--- trunk/include/sh_ignore.h	(revision 169)
+++ trunk/include/sh_ignore.h	(revision 170)
@@ -8,5 +8,5 @@
 int sh_ignore_chk_new (const char * chkpath);
 
-int sh_ignore_clean ();
+int sh_ignore_clean (void);
 
 #endif
Index: trunk/include/sh_prelude.h
===================================================================
--- trunk/include/sh_prelude.h	(revision 169)
+++ trunk/include/sh_prelude.h	(revision 170)
@@ -2,7 +2,7 @@
 #define SH_PRELUDE_H
 
-void sh_prelude_reset();
-void sh_prelude_stop();
-int  sh_prelude_init();
+void sh_prelude_reset(void);
+void sh_prelude_stop(void);
+int  sh_prelude_init(void);
 
 int sh_prelude_set_profile(const char *arg);
Index: trunk/include/sh_pthread.h
===================================================================
--- trunk/include/sh_pthread.h	(revision 169)
+++ trunk/include/sh_pthread.h	(revision 170)
@@ -119,5 +119,5 @@
  * ----   Initialize thread-specific conversion area   ----
  */
-extern int sh_g_thread();
+extern int sh_g_thread(void);
 
 
Index: trunk/include/sh_socket.h
===================================================================
--- trunk/include/sh_socket.h	(revision 169)
+++ trunk/include/sh_socket.h	(revision 170)
@@ -14,8 +14,8 @@
 
 
-int    sh_socket_open_int ();
-int    sh_socket_remove ();
+int    sh_socket_open_int (void);
+int    sh_socket_remove (void);
 char * sh_socket_check(const char * client_name);
-int    sh_socket_poll();
+int    sh_socket_poll(void);
 void   sh_socket_add2reload (const char * clt);
 
Index: trunk/include/sh_tiger.h
===================================================================
--- trunk/include/sh_tiger.h	(revision 169)
+++ trunk/include/sh_tiger.h	(revision 170)
@@ -42,5 +42,5 @@
  * 0 = tiger192, 1 = sha1, 2 = md5
  */
-int sh_tiger_get_hashtype ();
+int sh_tiger_get_hashtype (void);
 
 /* GnuPG-like format, returns allocated memory
Index: trunk/include/sh_unix.h
===================================================================
--- trunk/include/sh_unix.h	(revision 169)
+++ trunk/include/sh_unix.h	(revision 170)
@@ -93,4 +93,6 @@
 #define MODI_TXT ((1 << 14)|MODI_CHK)
 
+#define MODI_TXT_ENABLED(a) (((a)&(1 << 14))!=0)
+
 #define SH_TXT_MAX 9200
 
@@ -156,9 +158,9 @@
 /* mlock utilities
  */
-int sh_unix_mlock(char * file, int line, void * addr, size_t len);
+int sh_unix_mlock(const char * file, int line, void * addr, size_t len);
 int sh_unix_munlock(void * addr, size_t len);
-int sh_unix_count_mlock();
+int sh_unix_count_mlock(void);
 /* public for unit tests */
-int sh_unix_pagesize();
+int sh_unix_pagesize(void);
 unsigned long sh_unix_lookup_page(void * in_addr, size_t len, int * num_pages);
 
@@ -183,5 +185,5 @@
  */
 int  sh_unix_set_io_limit (const char * c);
-void sh_unix_io_pause ();
+void sh_unix_io_pause (void);
 
 /* get file type
@@ -191,9 +193,9 @@
 /* reset masks for policies
  */
-int sh_unix_maskreset();
+int sh_unix_maskreset(void);
 
 /* return true if database is remote
  */
-int file_is_remote ();
+int file_is_remote (void);
 
 /* return the path to the configuration/database file
@@ -220,9 +222,9 @@
 /* write the PID file
  */
-int sh_unix_write_pid_file();
+int sh_unix_write_pid_file(void);
 
 /* rm the PID file
  */
-int sh_unix_rm_pid_file();
+int sh_unix_rm_pid_file(void);
 
 
Index: trunk/include/sh_userfiles.h
===================================================================
--- trunk/include/sh_userfiles.h	(revision 169)
+++ trunk/include/sh_userfiles.h	(revision 170)
@@ -20,5 +20,5 @@
 int sh_userfiles_set_interval(const char *c);
 int sh_userfiles_set_active(const char *c);
-int sh_userfiles_check_internal();
+int sh_userfiles_check_internal(void);
 
 extern sh_rconf sh_userfiles_table[];
Index: trunk/include/sh_utils.h
===================================================================
--- trunk/include/sh_utils.h	(revision 169)
+++ trunk/include/sh_utils.h	(revision 170)
@@ -58,5 +58,5 @@
  *  generator. 
  */
-UINT32 taus_get            ();  
+UINT32 taus_get            (void);  
 double taus_get_double     (void *vstate);  /* fast */
 int    taus_seed           (void);
Index: trunk/include/slib.h
===================================================================
--- trunk/include/slib.h	(revision 169)
+++ trunk/include/slib.h	(revision 170)
@@ -123,7 +123,7 @@
 #endif
 
-  int dlog (int flag, char * file, int line, const char *fmt, ...);
-
-  char * sl_get_errmsg();
+  int dlog (int flag, const char * file, int line, const char *fmt, ...);
+
+  char * sl_get_errmsg(void);
 
   /* ---------------------------------------------------------------- 
@@ -133,5 +133,5 @@
    * ---------------------------------------------------------------- */
 
-  int sl_test_heap();
+  int sl_test_heap(void);
 
   /* ---------------------------------------------------------------- 
@@ -143,9 +143,9 @@
   extern int sl_useCaps;
 
-  int sl_drop_cap ();
-  int sl_drop_cap_sub();
-  int sl_get_cap_sub();
-  int sl_drop_cap_qdel();
-  int sl_get_cap_qdel();
+  int sl_drop_cap (void);
+  int sl_drop_cap_sub(void);
+  int sl_get_cap_sub(void);
+  int sl_drop_cap_qdel(void);
+  int sl_get_cap_qdel(void);
 
   /* ---------------------------------------------------------------- 
@@ -233,5 +233,5 @@
    * UID HANDLING FUNCTIONS.
    */
-  int sl_policy_get_user(char *username);  /* drop SUID to <username>  */ 
+  int sl_policy_get_user(const char *username);  /* drop SUID to <username>  */ 
   int sl_policy_get_real(char *username);  /* drop privs to <username> */
   int sl_policy_get_root(void);            /* drop SUID to root        */
@@ -250,5 +250,5 @@
    */
   int sl_get_euid(/*@out@*/uid_t * ret);
-  uid_t sl_ret_euid();
+  uid_t sl_ret_euid(void);
 
   /*
@@ -388,9 +388,9 @@
   /* Write file.
    */
-  int sl_write (SL_TICKET ticket, void * msg, long nbytes);
+  int sl_write (SL_TICKET ticket, const void * msg, long nbytes);
 
   /* Write file, terminate with newline.
    */
-  int sl_write_line (SL_TICKET ticket, void * msg, long nbytes);
+  int sl_write_line (SL_TICKET ticket, const void * msg, long nbytes);
 
   /* As above, but only for non-constant strings.
@@ -412,5 +412,5 @@
   /* purge list of trusted users
    */
-  int  sl_trust_purge_user ();
+  int  sl_trust_purge_user (void);
 
   /* Add a trusted user.
@@ -540,8 +540,8 @@
 void sl_stack_push(char * c, char * file, int line);
 void sl_stack_pop(char * c, char * file, int line);
-void sl_stack_print();
-#endif
-void sl_trace_in   (char * str, char * file, int line);
-void sl_trace_out  (char * str, char * file, int line);
+void sl_stack_print(void);
+#endif
+void sl_trace_in   (const char * str, const char * file, int line);
+void sl_trace_out  (const char * str, const char * file, int line);
 int  sl_trace_file (const char * str);
 int  sl_trace_use  (const char * str);
