Index: trunk/include/samhain.h
===================================================================
--- trunk/include/samhain.h	(revision 145)
+++ trunk/include/samhain.h	(revision 149)
@@ -48,8 +48,12 @@
  */
 #define SOCKPASS_MAX 14
-#define USER_MAX  20
-#define GROUP_MAX 20
-#define TIM_MAX   32
-
+#define USER_MAX     20
+#define GROUP_MAX    20
+#define TIM_MAX      32
+
+#define CMODE_SIZE   11
+
+#define ATTRBUF_SIZE 16
+#define ATTRBUF_USED 12
 
 /* The number of bytes in a key,  
@@ -159,5 +163,4 @@
 #define SET_SH_FFLAG_SUIDCHK(a)     ((a) |= SH_FFLAG_SUIDCHK)
 #define CLEAR_SH_FFLAG_SUIDCHK(a)   ((a) &= ~SH_FFLAG_SUIDCHK)
-
 
 
@@ -340,8 +343,29 @@
 
 #if defined(__GNUC__) && (__GNUC__ >= 4)
-#define SH_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
-#else
-#define SH_GNUC_NULL_TERMINATED
-#endif
+#define SH_GNUC_SENTINEL __attribute__((__sentinel__))
+#else
+#define SH_GNUC_SENTINEL
+#endif
+
+#if defined(__GNUC__) && (__GNUC__ >= 3)
+#undef  SH_GNUC_PURE
+#define SH_GNUC_PURE     __attribute__((pure))
+#undef  SH_GNUC_CONST
+#define SH_GNUC_CONST	 __attribute__((const))
+#undef  SH_GNUC_NORETURN
+#define SH_GNUC_NORETURN __attribute__((noreturn))
+#undef  SH_GNUC_MALLOC
+#define SH_GNUC_MALLOC   __attribute__((malloc))
+#else
+#undef  SH_GNUC_PURE
+#define SH_GNUC_PURE
+#undef  SH_GNUC_CONST
+#define SH_GNUC_CONST
+#undef  SH_GNUC_NORETURN
+#define SH_GNUC_NORETURN
+#undef  SH_GNUC_MALLOC
+#define SH_GNUC_MALLOC
+#endif
+
 
 /* The semantics of the built-in are that it is expected that expr == const
Index: trunk/include/sh_mem.h
===================================================================
--- trunk/include/sh_mem.h	(revision 145)
+++ trunk/include/sh_mem.h	(revision 149)
@@ -38,7 +38,14 @@
 #else
 
+#if defined(__GNUC__) && (__GNUC__ >= 3)
+#undef  SH_GNUC_MALLOC
+#define SH_GNUC_MALLOC   __attribute__((malloc))
+#else
+#undef  SH_GNUC_MALLOC
+#define SH_GNUC_MALLOC
+#endif
 
 void   sh_mem_free (/*@only@*//*@out@*//*@null@*/ void * a);
-/*@only@*//*@notnull@*/void * sh_mem_malloc (size_t size);
+/*@only@*//*@notnull@*/void * sh_mem_malloc (size_t size) SH_GNUC_MALLOC;
 
 #define SH_FREE(a)   sh_mem_free(a)
Index: trunk/include/sh_suidchk.h
===================================================================
--- trunk/include/sh_suidchk.h	(revision 145)
+++ trunk/include/sh_suidchk.h	(revision 149)
@@ -6,9 +6,9 @@
 
 #ifdef SH_USE_SUIDCHK
-int sh_suidchk_init  (struct mod_type * arg);
-int sh_suidchk_timer (time_t tcurrent);
-int sh_suidchk_check (void);
-int sh_suidchk_end   (void);
-int sh_suidchk_free_schedule (void);
+int sh_suidchk_init   (struct mod_type * arg);
+int sh_suidchk_timer  (time_t tcurrent);
+int sh_suidchk_check  (void);
+int sh_suidchk_end    (void);
+int sh_suidchk_reconf (void);
 
 int sh_suidchk_set_activate   (const char * c);
Index: trunk/include/sh_unix.h
===================================================================
--- trunk/include/sh_unix.h	(revision 145)
+++ trunk/include/sh_unix.h	(revision 149)
@@ -120,7 +120,7 @@
 #if defined(__linux__) || defined(HAVE_STAT_FLAGS)
   unsigned long    attributes;
-  char             c_attributes[16];
-#endif
-  char             c_mode[11];
+  char             c_attributes[ATTRBUF_SIZE];
+#endif
+  char             c_mode[CMODE_SIZE];
   uid_t            owner;
   char             c_owner[USER_MAX+2];
Index: trunk/include/sh_utils.h
===================================================================
--- trunk/include/sh_utils.h	(revision 145)
+++ trunk/include/sh_utils.h	(revision 149)
@@ -64,9 +64,9 @@
 /* returns allocated memory
  */
-char * sh_util_strdup (const char * str);
+char * sh_util_strdup (const char * str) SH_GNUC_MALLOC;
 
 /* returns allocated memory
  */
-char * sh_util_strdup_l (const char * str, size_t len);
+char * sh_util_strdup_l (const char * str, size_t len) SH_GNUC_MALLOC;
 
 /* returns pointer within str
@@ -119,5 +119,5 @@
 /* read a hexchar, return int value (0-15)
  */
-int sh_util_hexchar( char c );
+int sh_util_hexchar( char c ) SH_GNUC_CONST;
 
 /* change verifier 
@@ -159,9 +159,9 @@
  * Argument list must be NULL terminated.
  */
-char * sh_util_strconcat (const char * arg1, ...) SH_GNUC_NULL_TERMINATED;
+char * sh_util_strconcat (const char * arg1, ...) SH_GNUC_MALLOC SH_GNUC_SENTINEL;
 
 /* check if string is numeric only
  */
-int sh_util_isnum (char *str);
+int sh_util_isnum (const char *str) SH_GNUC_PURE;
 
 /* init a key w/random string
@@ -176,5 +176,5 @@
 /* returns freshly allocated memory, return value should be free'd
  */
-char * sh_util_safe_name (const char * name);
+char * sh_util_safe_name (const char * name) SH_GNUC_MALLOC SH_GNUC_PURE;
 
 /* check max size of printf result string
Index: trunk/include/sh_utmp.h
===================================================================
--- trunk/include/sh_utmp.h	(revision 145)
+++ trunk/include/sh_utmp.h	(revision 149)
@@ -6,9 +6,9 @@
 
 #ifdef SH_USE_UTMP
-int sh_utmp_init  (struct mod_type * arg);
-int sh_utmp_timer (time_t tcurrent);
-int sh_utmp_check (void);
-int sh_utmp_end (void);
-int sh_utmp_null (void);
+int sh_utmp_init   (struct mod_type * arg);
+int sh_utmp_timer  (time_t tcurrent);
+int sh_utmp_check  (void);
+int sh_utmp_end    (void);
+int sh_utmp_reconf (void);
 
 int sh_utmp_set_login_activate (const char * c);
Index: trunk/include/slib.h
===================================================================
--- trunk/include/slib.h	(revision 145)
+++ trunk/include/slib.h	(revision 149)
@@ -63,4 +63,12 @@
 #define SH_PWBUF_SIZE  4096
 
+
+#if defined(__GNUC__) && (__GNUC__ >= 3)
+#undef  SL_GNUC_CONST
+#define SL_GNUC_CONST   __attribute__((const))
+#else
+#undef  SH_GNUC_CONST
+#define SH_GNUC_CONST
+#endif
 
 /*
@@ -405,11 +413,11 @@
   /* Overflow tests
    */
-  int sl_ok_muli (int a, int b);
-  int sl_ok_divi (int a, int b);
-  int sl_ok_addi (int a, int b);
-  int sl_ok_subi (int a, int b);
-
-  int sl_ok_muls (size_t a, size_t b);
-  int sl_ok_adds (size_t a, size_t b);
+  int sl_ok_muli (int a, int b) SL_GNUC_CONST;
+  int sl_ok_divi (int a, int b) SL_GNUC_CONST;
+  int sl_ok_addi (int a, int b) SL_GNUC_CONST;
+  int sl_ok_subi (int a, int b) SL_GNUC_CONST;
+
+  int sl_ok_muls (size_t a, size_t b) SL_GNUC_CONST;
+  int sl_ok_adds (size_t a, size_t b) SL_GNUC_CONST;
 
 
