File xinetd-2.3.14-strict-aliasing-fix.diff of Package xinetd

--- xinetd/sensor.c
+++ xinetd/sensor.c
@@ -4,10 +4,14 @@
  * and conditions for redistribution.
  */
 
+#define _XOPEN_SOURCE 1
+#include <time.h>
+#undef _XOPEN_SOURCE
+#include <ctype.h>
+
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <time.h>
 
 #include "config.h"
 #include "pset.h"
@@ -101,15 +105,20 @@
 	    /* Here again, eh?...update time stamp. */
             char *exp_time;
 	    time_t stored_time;
+	    struct tm tm_stored_time;
+	    char *parsed_str;
 
 	    item_matched--; /* Is # plus 1, to even get here must be >= 1 */
             exp_time = pset_pointer( global_no_access_time, item_matched ) ;
             if (exp_time == NULL)
-               return ;
+	      return ;
 
-            if ( parse_base10(exp_time, (int *)&stored_time) )
-            {  /* if never let them off, bypass */
-               if (stored_time != -1)
+	    if ((parsed_str = strptime(exp_time, "%s", &tm_stored_time)) != NULL) 
+	    {
+	       while (*parsed_str != '\0' && isspace(*parsed_str))
+		  parsed_str++;
+	       stored_time = mktime(&tm_stored_time);
+	       if (*parsed_str == '\0')
                {
                   time_t nowtime, new_time;
 
openSUSE Build Service is sponsored by