Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac	(revision 589)
+++ /trunk/configure.ac	(revision 590)
@@ -4,5 +4,5 @@
 dnl AU_ALIAS([_AC_INIT_help], [SH_INIT_HELP])
 
-AC_INIT([samhain],[4.5.2])
+AC_INIT([samhain],[4.5.3])
 AC_CONFIG_SRCDIR(src/samhain.c)
 
Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 589)
+++ /trunk/docs/Changelog	(revision 590)
@@ -7,4 +7,6 @@
 	* move logfile monitor module from PCRE to PCRE2 (PCRE is end of life and no
 	longer actively maintained)
+	* fix obsolete gpg option --secret-keyring used in samhainadmin script
+	* fix some more warnings, mostly false positives from cppcheck
 
 4.5.2 (02-01-2025):
Index: /trunk/src/rijndael-api-fst.c
===================================================================
--- /trunk/src/rijndael-api-fst.c	(revision 589)
+++ /trunk/src/rijndael-api-fst.c	(revision 590)
@@ -103,4 +103,5 @@
 
 		/* memcpy(key->keyMaterial, keyMaterial, keyLen/8); */
+		/* cppcheck-suppress uninitvar */
 		memcpy(key->keyMaterial, temp, keyLen/8);
 	}
Index: /trunk/src/sh_files.c
===================================================================
--- /trunk/src/sh_files.c	(revision 589)
+++ /trunk/src/sh_files.c	(revision 590)
@@ -338,4 +338,5 @@
     here = (dirstack_t *) inptr;
 
+  /* cppcheck-suppress uninitStructMember */
   if (here->name != NULL)
     SH_FREE(here->name);
@@ -892,5 +893,5 @@
 static int sh_files_parse_mask (unsigned long * mask, const char * str)
 {
-  int l, i = 0, act = 0, k = 0;
+  int l = 0, i = 0, act = 0, k = 0;
   char  myword[64];
   
@@ -1396,4 +1397,5 @@
     here = (sh_globstack_t *) inptr;
 
+  /* cppcheck-suppress uninitStructMember */
   if (here->name != NULL)
     SH_FREE(here->name);
Index: /trunk/src/sh_hash.c
===================================================================
--- /trunk/src/sh_hash.c	(revision 589)
+++ /trunk/src/sh_hash.c	(revision 590)
@@ -1287,4 +1287,6 @@
 #if defined(__linux__) || defined(HAVE_STAT_FLAGS)
   p.attributes  = (UINT32) buf->attributes;
+#else
+  p.attributes  = (UINT32) 0;
 #endif
   p.linkmode    = (UINT32) buf->linkmode;
Index: /trunk/src/sh_log_parse_pacct.c
===================================================================
--- /trunk/src/sh_log_parse_pacct.c	(revision 589)
+++ /trunk/src/sh_log_parse_pacct.c	(revision 590)
@@ -252,4 +252,5 @@
       
 #if defined(ac_flagx)
+      /* cppcheck-suppress syntaxError */
       expand_flags(rec.ac_flagx, fl);
 #else
Index: /trunk/src/sh_portcheck.c
===================================================================
--- /trunk/src/sh_portcheck.c	(revision 589)
+++ /trunk/src/sh_portcheck.c	(revision 590)
@@ -957,5 +957,5 @@
   int                retval;
   char             * p = NULL;
-  char               buf[8];
+  char               buf[8] = { 0 };
 #ifndef TEST_ONLY
   char               errmsg[256];
Index: /trunk/src/sh_registry.c
===================================================================
--- /trunk/src/sh_registry.c	(revision 589)
+++ /trunk/src/sh_registry.c	(revision 590)
@@ -905,4 +905,5 @@
 			       qError,
 			       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+			       /* cppcheck-suppress uninitvar */
 			       (LPTSTR) &lpMsgBuf,
 			       0, NULL );
@@ -1007,5 +1008,5 @@
 
   /* Returns 0 if !subkey */
-  /* cppcheck-suppress uninitvar */
+  /* cppcheck-suppress legacyUninitvar */
   return CheckThisSubkey (topKey, subkey, path, isSingle, 0);
 }
Index: /trunk/src/sh_suidchk.c
===================================================================
--- /trunk/src/sh_suidchk.c	(revision 589)
+++ /trunk/src/sh_suidchk.c	(revision 590)
@@ -1019,4 +1019,14 @@
   SL_ENTER(_("sh_suidchk_check_internal"));
 
+  if (iname == NULL)
+    {
+      TPT((0, FIL__, __LINE__ , _("msg=<directory name is NULL>\n")));
+      SL_RETURN( (-1), _("sh_suidchk_check_internal"));
+    }
+
+  if (sig_urgent > 0) {
+    SL_RETURN( (0), _("sh_suidchk_check_internal"));
+  }
+
   /* Take the address to keep gcc from putting it into a register. 
    * Avoids the 'clobbered by longjmp' warning. 
@@ -1024,14 +1034,4 @@
   sh_dummy_idirlist = (void*) &dirlist;
   sh_dummy_itmp     = (void*) &tmp;
-
-  if (iname == NULL)
-    {
-      TPT((0, FIL__, __LINE__ , _("msg=<directory name is NULL>\n")));
-      SL_RETURN( (-1), _("sh_suidchk_check_internal"));
-    }
-
-  if (sig_urgent > 0) {
-    SL_RETURN( (0), _("sh_suidchk_check_internal"));
-  }
 
   thisDir = opendir (iname);
@@ -1047,4 +1047,6 @@
       SH_MUTEX_UNLOCK(mutex_thread_nolog);
       SH_FREE(tmp);
+      sh_dummy_idirlist = NULL;
+      sh_dummy_itmp     = NULL;
       SL_RETURN( (-1), _("sh_suidchk_check_internal"));
     }
@@ -1412,4 +1414,7 @@
   kill_sh_dirlist (dirlist_orig);
 
+  sh_dummy_idirlist = NULL;
+  sh_dummy_itmp     = NULL;
+
   SL_RETURN( (0), _("sh_suidchk_check_internal"));
 }
@@ -2193,6 +2198,5 @@
    Return "unknown" if its filesystem type is unknown.  */
 
-static char *
-filesystem_type (char * path, char * relpath, struct stat * statp)
+static char * filesystem_type (char * path, char * relpath, struct stat * statp)
 {
   static char *current_fstype = NULL;
@@ -2218,9 +2222,5 @@
 void * sh_dummy_2229_type;
 
-static char *
-filesystem_type_uncached (path, relpath, statp)
-     char *path;
-     char *relpath;
-     struct stat *statp;
+static char * filesystem_type_uncached (char * path, char * relpath, struct stat * statp)
 {
   char * type = NULL;
@@ -2234,11 +2234,11 @@
   struct mntent *mnt;
 
+  if (path == NULL || relpath == NULL)
+    return NULL;
+
   /* Take the address to keep gcc from putting it into a register. 
    * Avoids the 'clobbered by longjmp' warning. 
    */
   sh_dummy_2229_type = (void *) &type;
-
-  if (path == NULL || relpath == NULL)
-    return NULL;
 
   mfp = setmntent (table, "r");
@@ -2250,4 +2250,5 @@
 		       _("filesystem_type_uncached") );
       SH_MUTEX_UNLOCK(mutex_thread_nolog);
+      sh_dummy_2229_type = NULL;
       return NULL;
     }
@@ -2378,4 +2379,5 @@
 			   _("filesystem_type_uncached") );
 	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
+	  sh_dummy_2229_type = NULL;
 	  return NULL;
 	}
@@ -2406,4 +2408,5 @@
 			   _("filesystem_type_uncached") );
 	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
+	  sh_dummy_2229_type = NULL;
 	  return NULL;
 	}
@@ -2453,4 +2456,5 @@
 			   _("filesystem_type_uncached") );
 	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
+	  sh_dummy_2229_type = NULL;
 	  return NULL;
 	}
@@ -2492,4 +2496,5 @@
   fstype_known = (int)(type != NULL);
 
+  sh_dummy_2229_type = NULL;
   return sh_util_strdup (type ? type : "unknown");
 }
@@ -2500,7 +2505,5 @@
    part of CP. */
 
-static int
-xatoi (cp)
-     const char *cp;
+static int xatoi (const char * cp)
 {
   int val;
Index: /trunk/src/sh_unix.c
===================================================================
--- /trunk/src/sh_unix.c	(revision 589)
+++ /trunk/src/sh_unix.c	(revision 590)
@@ -17,4 +17,6 @@
 /*  along with this program; if not, write to the Free Software            */
 /*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              */
+
+/* cppcheck-suppress-file unknownMacro */
 
 #include "config_xor.h"
@@ -2412,5 +2414,5 @@
   char          AsciiTime[81];                       /* local time   */
   time_t        time_now;
-  struct tm   * time_ptr;
+  struct tm   * time_ptr = NULL;
 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
   struct tm     time_tm;
@@ -2546,4 +2548,5 @@
 #endif
     }
+
   if (time_ptr != NULL) 
     {
Index: /trunk/src/sh_utils.c
===================================================================
--- /trunk/src/sh_utils.c	(revision 589)
+++ /trunk/src/sh_utils.c	(revision 590)
@@ -769,5 +769,5 @@
   char        K[KEY_BLOCK];
   char        outer[KEY_BLOCK];
-  char      * inner;
+  char      * inner = NULL;
   UINT32    * h1;
   UINT32    * h2;
Index: /trunk/src/sh_xfer_server.c
===================================================================
--- /trunk/src/sh_xfer_server.c	(revision 589)
+++ /trunk/src/sh_xfer_server.c	(revision 590)
@@ -484,4 +484,5 @@
     here = (client_t *) inptr;
 
+  /* cppcheck-suppress uninitStructMember */
   if (here->hostname != NULL)
     SH_FREE(here->hostname);
@@ -506,4 +507,5 @@
     here = (alias_t *) inptr;
 
+  /* cppcheck-suppress uninitStructMember */
   if (here->alias != NULL)
     SH_FREE(here->alias);
Index: /trunk/test/testrun_1f.sh
===================================================================
--- /trunk/test/testrun_1f.sh	(revision 589)
+++ /trunk/test/testrun_1f.sh	(revision 590)
@@ -63,6 +63,6 @@
 prep_sign_file ()
 {
-    scripts/samhainadmin.pl -s ./test/gnupg/ -m R $1 >/dev/null
-    scripts/samhainadmin.pl -s ./test/gnupg/ -k 8A0B337A -m E $1 >/dev/null
+    scripts/samhainadmin.pl  -m R $1 >/dev/null
+    scripts/samhainadmin.pl  -k 8A0B337A -m E $1 >/dev/null
 }
 
Index: /trunk/test/testrun_2g.sh
===================================================================
--- /trunk/test/testrun_2g.sh	(revision 589)
+++ /trunk/test/testrun_2g.sh	(revision 590)
@@ -336,5 +336,5 @@
 	UUID=$(uuidgen)
 	if [ x"$1" != "xnosig" ]; then
-	    scripts/samhainadmin.pl -s ./test/gnupg/ -k 8A0B337A -m E ./file.delta >/dev/null
+	    scripts/samhainadmin.pl -k 8A0B337A -m E ./file.delta >/dev/null
 	fi
 	if [ x"$1" == "xnodelta" ]; then
@@ -612,11 +612,11 @@
 testrun2g_signrc ()
 {
-    scripts/samhainadmin.pl -s ./test/gnupg/ -m R $1 >/dev/null
-    scripts/samhainadmin.pl -s ./test/gnupg/ -k 8A0B337A -m E $1 >/dev/null
+    scripts/samhainadmin.pl  -m R $1 >/dev/null
+    scripts/samhainadmin.pl  -k 8A0B337A -m E $1 >/dev/null
 }
 
 testrun2g_signdb ()
 {
-    scripts/samhainadmin.pl -s ./test/gnupg/ -k 8A0B337A -m E ./.samhain_file >/dev/null
+    scripts/samhainadmin.pl  -k 8A0B337A -m E ./.samhain_file >/dev/null
 }
 
