Index: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in	(revision 289)
+++ trunk/Makefile.in	(revision 290)
@@ -1751,5 +1751,5 @@
 dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h 
 t-test1.o: $(srcsrc)/t-test1.c Makefile config.h $(srcinc)/malloc.h 
-sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error_min.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h 
+sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error_min.h $(srcinc)/sh_pthread.h 
 sh_log_parse_syslog.o: $(srcsrc)/sh_log_parse_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
 sh_log_parse_pacct.o: $(srcsrc)/sh_log_parse_pacct.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
Index: trunk/aclocal.m4
===================================================================
--- trunk/aclocal.m4	(revision 289)
+++ trunk/aclocal.m4	(revision 290)
@@ -1196,6 +1196,12 @@
       ])
     if test $pie_cv_cc = yes; then
+      case "$host_os" in
+      *cygwin*)
+      ;;
+      *)
       PIE_CFLAGS="-fPIE"
       PIE_LDFLAGS="-pie"
+      ;;
+      esac
     fi
   fi
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac	(revision 289)
+++ trunk/configure.ac	(revision 290)
@@ -12,5 +12,5 @@
 dnl start
 dnl
-AM_INIT_AUTOMAKE(samhain, 2.7.1)
+AM_INIT_AUTOMAKE(samhain, 2.7.2)
 AC_DEFINE([SAMHAIN], 1, [Application is samhain])
 AC_CANONICAL_HOST
@@ -232,5 +232,5 @@
 	elf.h linux/elf.h \
 	paths.h arpa/nameser.h arpa/nameser_compat.h \
-	rpc/rpcent.h sys/statvfs.h,
+	rpc/rpcent.h rpc/rpc.h sys/statvfs.h,
 	[],
 	[],
Index: trunk/depend.dep
===================================================================
--- trunk/depend.dep	(revision 289)
+++ trunk/depend.dep	(revision 290)
@@ -68,5 +68,5 @@
 dnmalloc-portable.o: $(srcsrc)/dnmalloc-portable.c Makefile config.h 
 dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h 
-sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error_min.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h 
+sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error_min.h $(srcinc)/sh_pthread.h 
 sh_log_parse_syslog.o: $(srcsrc)/sh_log_parse_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
 sh_log_parse_pacct.o: $(srcsrc)/sh_log_parse_pacct.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
Index: trunk/depend.sum
===================================================================
--- trunk/depend.sum	(revision 289)
+++ trunk/depend.sum	(revision 290)
@@ -1,1 +1,1 @@
-3590773370
+3512130170
Index: trunk/docs/Changelog
===================================================================
--- trunk/docs/Changelog	(revision 289)
+++ trunk/docs/Changelog	(revision 290)
@@ -1,3 +1,12 @@
 2.7.2:
+	* sh_utils.c: fixed an endianess issue that prevented cross-verification
+	  of email signatures (reported by A. Zangerl)
+        * sh_login_track.c: fix compiler warning (ignored return value 
+          of fwrite)
+	* sh_readconf.c: fix comparison of SeverityUserX string
+	  (reported by max__)
+	* sh_processcheck.c: sh_prochk_set_maxpid: set retval on success
+	  (reported by max__)
+	* fixed some compiler warnings on cygwin
 	* sh_extern.c: As reported by T. Luettgert, gcc 4.4.4 on Fedora 13 
 	  will throw a warning if execve is called with a NULL argv pointer. 
Index: trunk/src/sh_login_track.c
===================================================================
--- trunk/src/sh_login_track.c	(revision 289)
+++ trunk/src/sh_login_track.c	(revision 290)
@@ -285,5 +285,5 @@
 	  while (entry)
 	    {
-	      fwrite(&(entry->data), sizeof(struct sh_track_entry_data), 1, fp);
+	      n = fwrite(&(entry->data), sizeof(struct sh_track_entry_data), 1, fp);
 	      entry = entry->next;
 	    }
Index: trunk/src/sh_mail.c
===================================================================
--- trunk/src/sh_mail.c	(revision 289)
+++ trunk/src/sh_mail.c	(revision 290)
@@ -228,6 +228,7 @@
 	    }
 	  
-
-	  theSig = sh_util_siggen (key2, bufc, sl_strlen(bufc), sigbuf, sizeof(sigbuf));
+	  theSig = sh_util_siggen (key2, bufc, sl_strlen(bufc), 
+				   sigbuf, sizeof(sigbuf));
+
 	  if (sl_strncmp (key, 
 			  theSig,
Index: trunk/src/sh_port2proc.c
===================================================================
--- trunk/src/sh_port2proc.c	(revision 289)
+++ trunk/src/sh_port2proc.c	(revision 290)
@@ -24,4 +24,6 @@
 #include <string.h>
 #include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
 #include <unistd.h>
 
@@ -48,4 +50,7 @@
 /* #define DEBUG_P2P 1 */
 
+#include "samhain.h"
+#include "sh_utils.h"
+
 /****************************************************************************
  *
@@ -55,7 +60,5 @@
 #if defined(__linux__) || defined(__FreeBSD__)
  
-#include "samhain.h"
 #include "sh_error_min.h"
-#include "sh_utils.h"
 #include "sh_pthread.h"
 
Index: trunk/src/sh_portcheck.c
===================================================================
--- trunk/src/sh_portcheck.c	(revision 289)
+++ trunk/src/sh_portcheck.c	(revision 290)
@@ -47,4 +47,5 @@
 
 #define PORTMAP
+#ifdef  HAVE_RPC_RPC_H
 #include <rpc/rpc.h>
 #ifdef  HAVE_RPC_RPCENT_H
@@ -53,4 +54,5 @@
 #include <rpc/pmap_clnt.h>
 #include <rpc/pmap_prot.h>
+#endif
 #include <netdb.h>
 
@@ -284,4 +286,5 @@
 #endif
 
+#ifdef  HAVE_RPC_RPC_H
 static char * sh_getrpcbynumber (int number, char * buf, size_t len)
 {
@@ -324,4 +327,5 @@
   return NULL;
 }
+#endif
 
 static char * sh_getservbyport (int port, const char * proto_in, char * buf, size_t len)
@@ -756,4 +760,5 @@
 			      unsigned long prot)
 {
+#ifdef  HAVE_RPC_RPC_H
   struct pmaplist * head;
   char *r;
@@ -786,5 +791,9 @@
       while (head != NULL);
     }
-
+#else
+  (void) port;
+  (void) address;
+  (void) prot;
+#endif
   return NULL;
 }
@@ -1665,4 +1674,5 @@
   char * p;
 
+#ifdef HAVE_RPC_RPC_H
   p = sh_getrpcbynumber(0, buf, sizeof(buf));
   CuAssertTrue(tc, p == NULL);
@@ -1677,12 +1687,15 @@
   CuAssertTrue(tc, 0 == strcmp(p, "ypbind"));
   CuAssertTrue(tc, 0 == strcmp(buf, "ypbind"));
+#endif
 
   p = sh_getservbyport(0, SH_PROTO_STR(IPPROTO_TCP), buf, sizeof(buf));
   CuAssertTrue(tc, p == NULL);
 
+#if !defined(HOST_IS_CYGWIN)
   p = sh_getservbyport(22, SH_PROTO_STR(IPPROTO_TCP), buf, sizeof(buf));
   CuAssertPtrNotNull(tc, p);
   CuAssertTrue(tc, 0 == strcmp(p, "ssh"));
   CuAssertTrue(tc, 0 == strcmp(buf, "ssh"));
+#endif
 
   p = sh_getservbyport(13, SH_PROTO_STR(IPPROTO_UDP), buf, sizeof(buf));
Index: trunk/src/sh_prelude.c
===================================================================
--- trunk/src/sh_prelude.c	(revision 289)
+++ trunk/src/sh_prelude.c	(revision 290)
@@ -705,14 +705,8 @@
 #if defined(SH_WITH_SERVER)
         /* when using yule, theres a msg=<... msg=<...> >*/
-	do {
-	        msg = ptr;
-		ptr = get_value(msg, _("msg"), NULL);
-		if ( ! ptr ) {
-		        ptr = msg;
-			break;
-		} else {
-		        free(msg);
-		}
-	} while (1);
+	while ( (msg = get_value(ptr, _("msg"), NULL)) ) {
+	        free(ptr);
+		ptr = msg;
+	}
 #endif        
 
@@ -1231,4 +1225,6 @@
         if ( inet_peer_ip != NULL){
                 ret = idmef_target_new_node(target, &node);
+		if ( ret < 0 )
+                          goto err;
         
 		ret = node_set_address(node, inet_peer_ip); 
@@ -1239,14 +1235,10 @@
         }
         else
+#endif        
         if ( idmef_analyzer_get_node(prelude_client_get_analyzer(client)) ) {
                 idmef_node_ref(idmef_analyzer_get_node(prelude_client_get_analyzer(client)));
                 idmef_target_set_node(target, idmef_analyzer_get_node(prelude_client_get_analyzer(client)));
         }
-#else        
-        if ( idmef_analyzer_get_node(prelude_client_get_analyzer(client)) ) {
-                idmef_node_ref(idmef_analyzer_get_node(prelude_client_get_analyzer(client)));
-                idmef_target_set_node(target, idmef_analyzer_get_node(prelude_client_get_analyzer(client)));
-        }
-#endif        
+
         if ( strstr(message, _("path=")) ) {
 #if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
Index: trunk/src/sh_processcheck.c
===================================================================
--- trunk/src/sh_processcheck.c	(revision 289)
+++ trunk/src/sh_processcheck.c	(revision 290)
@@ -611,4 +611,5 @@
     sh_prochk_maxpid = value + 1;
     userdef_maxpid   = 1;
+    retval = 0;
   }
 
Index: trunk/src/sh_readconf.c
===================================================================
--- trunk/src/sh_readconf.c	(revision 289)
+++ trunk/src/sh_readconf.c	(revision 290)
@@ -1393,5 +1393,5 @@
       i = 0;
       while (ident[i] != NULL) {
-	if (sl_strncmp (key, _(ident[i]), sl_strlen(ident[i])-1) == 0)
+	if (sl_strncmp (key, _(ident[i]), sl_strlen(ident[i])) == 0)
 	  {
 	    good_opt = 0;
Index: trunk/src/sh_schedule.c
===================================================================
--- trunk/src/sh_schedule.c	(revision 289)
+++ trunk/src/sh_schedule.c	(revision 290)
@@ -212,5 +212,5 @@
 	/*@+charint@*//* Incompatible types for == (char, char): ??? */
 	for (k = 0; k < 3; ++k)
-	  if (p[k] != '\0' && tolower(p[k]) == MonNames[j][k]) ++l;
+	  if (p[k] != '\0' && tolower((int) p[k]) == MonNames[j][k]) ++l;
 	/*@-charint@*/
 	if (l == 3)
@@ -224,5 +224,5 @@
 	/*@+charint@*//* Incompatible types for == (char, char): ??? */
 	for (k = 0; k < 3; ++k)
-	  if (p[k] != '\0' && tolower(p[k]) == DayNames[j][k]) ++l;
+	  if (p[k] != '\0' && tolower((int) p[k]) == DayNames[j][k]) ++l;
 	/*@-charint@*/
 	if (l == 3)
Index: trunk/src/sh_unix.c
===================================================================
--- trunk/src/sh_unix.c	(revision 289)
+++ trunk/src/sh_unix.c	(revision 290)
@@ -3508,4 +3508,6 @@
 	}
   }
+#else
+  (void) buf;
 #endif
 
Index: trunk/src/sh_utils.c
===================================================================
--- trunk/src/sh_utils.c	(revision 289)
+++ trunk/src/sh_utils.c	(revision 290)
@@ -871,4 +871,8 @@
     char c[sizeof(long)];
   } u;
+#ifdef WORDS_BIGENDIAN
+  unsigned char swap;
+  unsigned char * ii = (unsigned char *) dest;
+#endif
 
   SL_ENTER(_("sh_util_cpylong"));    
@@ -893,4 +897,8 @@
       ++i;
     }
+#ifdef WORDS_BIGENDIAN
+  swap = ii[0]; ii[0] = ii[3]; ii[3] = swap;
+  swap = ii[1]; ii[1] = ii[2]; ii[2] = swap;
+#endif
   SL_RET0(_("sh_util_cpylong"));
 }
Index: trunk/src/sh_utmp.c
===================================================================
--- trunk/src/sh_utmp.c	(revision 289)
+++ trunk/src/sh_utmp.c	(revision 290)
@@ -916,6 +916,10 @@
 #ifdef HAVE_UTADDR
       /*@-type@*//* ut_addr does exist !!! */
-      (void) sl_strlcpy((char*)(user->ut_ship), 
-			my_inet_ntoa(*(struct in_addr*)&(ut->ut_addr)), 16);
+      {
+	struct in_addr saddr;
+	memcpy (&saddr, &(ut->ut_addr), sizeof(struct in_addr));
+	(void) sl_strlcpy((char*)(user->ut_ship), 
+			  my_inet_ntoa(saddr), 16);
+      }
       /*@+type@*/
 #endif
Index: trunk/src/slib.c
===================================================================
--- trunk/src/slib.c	(revision 289)
+++ trunk/src/slib.c	(revision 290)
@@ -1028,9 +1028,9 @@
 	if (*one && *two)
 	  {
-	    if (tolower(*one) == tolower(*two))
+	    if (tolower((int) *one) == tolower((int) *two))
 	      {
 		++one; ++two;
 	      }
-	    else if (tolower(*one) < tolower(*two))
+	    else if (tolower((int) *one) < tolower((int) *two))
 	      return -1;
 	    else
