Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac	(revision 144)
+++ trunk/configure.ac	(revision 145)
@@ -13,5 +13,5 @@
 dnl start
 dnl
-AM_INIT_AUTOMAKE(samhain, 2.4.0)
+AM_INIT_AUTOMAKE(samhain, 2.4.0a)
 AC_CANONICAL_HOST
 
Index: trunk/docs/Changelog
===================================================================
--- trunk/docs/Changelog	(revision 144)
+++ trunk/docs/Changelog	(revision 145)
@@ -1,2 +1,6 @@
+2.4.0a:
+	* fix compile failure with --enable-static (reported by S. Clormann)
+	* fix potential deadlock if SIGHUP is received while suspended
+
 2.4.0:
 	* eliminate alarm() for I/O timeout (replaced by select)
Index: trunk/include/sh_static.h
===================================================================
--- trunk/include/sh_static.h	(revision 144)
+++ trunk/include/sh_static.h	(revision 145)
@@ -17,13 +17,13 @@
 
 struct passwd * sh_getpwnam(const char *name);
-int getpwnam_r(const char *name, struct passwd *pwbuf,
+int sh_getpwnam_r(const char *name, struct passwd *pwbuf,
                char *buf, size_t buflen, struct passwd **pwbufp);
 
 struct group * sh_getgrgid(gid_t gid);
-int getgrgid_r(gid_t gid, struct group *gbuf,
+int sh_getgrgid_r(gid_t gid, struct group *gbuf,
 	       char *buf, size_t buflen, struct group **gbufp);
 
 struct passwd * sh_getpwuid(uid_t uid);
-int getpwuid_r(uid_t uid, struct passwd *pwbuf,
+int sh_getpwuid_r(uid_t uid, struct passwd *pwbuf,
                char *buf, size_t buflen, struct passwd **pwbufp);
 
Index: trunk/src/samhain.c
===================================================================
--- trunk/src/samhain.c	(revision 144)
+++ trunk/src/samhain.c	(revision 145)
@@ -1723,5 +1723,6 @@
 	    }
 	  
-	  if (sig_config_read_again == 1) /* SIGHUP */
+	  if (sig_config_read_again == 1 && /* SIGHUP */
+	      sh_global_suspend_flag == 0)
 	    {
 	      TPT((0, FIL__, __LINE__, _("msg=<Re-read configuration.>\n")))
Index: trunk/src/sh_static.c
===================================================================
--- trunk/src/sh_static.c	(revision 144)
+++ trunk/src/sh_static.c	(revision 145)
@@ -94,8 +94,8 @@
 #define DO_GETXXKEY_R_PATHNAME  _PATH_PASSWD
 
-static int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
-			   GETXXKEY_R_ENTTYPE *__restrict resultbuf,
-			   char *__restrict buffer, size_t buflen,
-			   GETXXKEY_R_ENTTYPE **__restrict result)
+int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
+		    GETXXKEY_R_ENTTYPE *__restrict resultbuf,
+		    char *__restrict buffer, size_t buflen,
+		    GETXXKEY_R_ENTTYPE **__restrict result)
 {
   FILE *stream;
@@ -142,8 +142,8 @@
 #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP
 
-static int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
-			   GETXXKEY_R_ENTTYPE *__restrict resultbuf,
-			   char *__restrict buffer, size_t buflen,
-			   GETXXKEY_R_ENTTYPE **__restrict result)
+int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
+		    GETXXKEY_R_ENTTYPE *__restrict resultbuf,
+		    char *__restrict buffer, size_t buflen,
+		    GETXXKEY_R_ENTTYPE **__restrict result)
 {
   FILE *stream;
@@ -190,8 +190,8 @@
 #define DO_GETXXKEY_R_PATHNAME  _PATH_PASSWD
 
-static int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
-			   GETXXKEY_R_ENTTYPE *__restrict resultbuf,
-			   char *__restrict buffer, size_t buflen,
-			   GETXXKEY_R_ENTTYPE **__restrict result)
+int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
+		    GETXXKEY_R_ENTTYPE *__restrict resultbuf,
+		    char *__restrict buffer, size_t buflen,
+		    GETXXKEY_R_ENTTYPE **__restrict result)
 {
   FILE *stream;
@@ -238,8 +238,8 @@
 #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP
 
-static int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
-			   GETXXKEY_R_ENTTYPE *__restrict resultbuf,
-			   char *__restrict buffer, size_t buflen,
-			   GETXXKEY_R_ENTTYPE **__restrict result)
+int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
+		    GETXXKEY_R_ENTTYPE *__restrict resultbuf,
+		    char *__restrict buffer, size_t buflen,
+		    GETXXKEY_R_ENTTYPE **__restrict result)
 {
   FILE *stream;
@@ -1168,7 +1168,7 @@
 	DPRINTF("Looking up type %d answer for '%s'\n", type, name);
 
-	LOCK;
+	SH_MUTEX_LOCK_UNSAFE(resolv_lock);
 	ns %= nscount;
-	UNLOCK;
+	SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
 
 	while (retries++ < MAX_RETRIES) {
@@ -1181,10 +1181,10 @@
 
 		/* Mess with globals while under lock */
-		LOCK;
+		SH_MUTEX_LOCK_UNSAFE(resolv_lock);
 		++id;
 		id &= 0xffff;
 		h.id = id;
 		dns = nsip[ns];
-		UNLOCK;
+		SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
 
 		h.qdcount = 1;
@@ -1281,11 +1281,11 @@
 		DPRINTF("id = %d, qr = %d\n", h.id, h.qr);
 
-		LOCK;
+		SH_MUTEX_LOCK_UNSAFE(resolv_lock);
 		if ((h.id != id) || (!h.qr)) {
-			UNLOCK;
+			SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
 			/* unsolicited */
 			goto again;
 		}
-		UNLOCK;
+		SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
 
 
@@ -1369,7 +1369,7 @@
 		    } else {
 			/* next server, first search */
-			LOCK;
+			SH_MUTEX_LOCK_UNSAFE(resolv_lock);
 			ns = (ns + 1) % nscount;
-			UNLOCK;
+			SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
 			variant = 0;
 		    }
Index: trunk/test/testcompile.sh
===================================================================
--- trunk/test/testcompile.sh	(revision 144)
+++ trunk/test/testcompile.sh	(revision 145)
@@ -20,5 +20,5 @@
 #
 
-MAXTEST=65; export MAXTEST
+MAXTEST=71; export MAXTEST
 
 run_flawfinder ()
@@ -181,4 +181,20 @@
 	# test standalone compilation
 	#
+        TEST="${S}standalone static w/suidcheck w/procchk${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE distclean 
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  --enable-static --enable-suidcheck --enable-process-check > /dev/null 2>> test_log
+	#
+	let "num = num + 1" >/dev/null
+	testmake $? $num || let "numfail = numfail + 1"  >/dev/null
+	let "num = num + 1" >/dev/null
+	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+
+	#
+	# test standalone compilation
+	#
         TEST="${S}standalone w/procchk w/portchk${E}"
 	#
@@ -450,4 +466,31 @@
 	#
 	${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test   --with-timeserver=127.0.0.1 > /dev/null 2>> test_log   
+	#
+	let "num = num + 1" >/dev/null
+	testmake $? $num || let "numfail = numfail + 1" >/dev/null
+	let "num = num + 1" >/dev/null
+	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+
+	#
+	# test client/server compilation
+	#
+	TEST="${S}client/server application static w/timeserver${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=client  --enable-static --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test   --with-timeserver=127.0.0.1 > /dev/null 2>> test_log   
+	#
+	let "num = num + 1" >/dev/null
+	testmake $? $num || let "numfail = numfail + 1" >/dev/null
+	let "num = num + 1" >/dev/null
+	run_smatch $? $num || let "numfail = numfail + 1"  >/dev/null
+	
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-static --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test   --with-timeserver=127.0.0.1 > /dev/null 2>> test_log   
 	#
 	let "num = num + 1" >/dev/null
Index: trunk/test/testrun_1a.sh
===================================================================
--- trunk/test/testrun_1a.sh	(revision 144)
+++ trunk/test/testrun_1a.sh	(revision 145)
@@ -20,5 +20,5 @@
 #
 
-PREBUILDOPTS="--quiet $TRUST --enable-debug --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
+PREBUILDOPTS="--quiet $TRUST --enable-debug --enable-static --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
 export PREBUILDOPTS
 
