Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1584233
 поиск   регистрация   авторизация 
 
Группа :: Система/Основа
Пакет: xinetd

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: xinetd-2.3.13-owl-fixes.patch


diff -upk.orig xinetd-2.3.13.orig/xinetd/connection.c xinetd-2.3.13/xinetd/connection.c
--- xinetd-2.3.13.orig/xinetd/connection.c	2005-03-29 16:03:00 +0000
+++ xinetd-2.3.13/xinetd/connection.c	2005-06-28 16:11:39 +0000
@@ -216,7 +216,7 @@ void conn_dump( const connection_s *cp, 
 
    tabprint( fd, 1, "service = %s\n", SVC_ID( cp->co_sp ) ) ;
    tabprint( fd, 1, "descriptor = %d\n", cp->co_descriptor ) ;
-#if defined(__GNUC__) && !defined(__arch64__) && !defined(__alpha__)
+#if defined(__GNUC__) && !defined(__arch64__) && !defined(__alpha__) && !defined(__x86_64__)
    tabprint( fd, 1, "flags = %#llx\n", cp->co_flags ) ;
 #else
    tabprint( fd, 1, "flags = %#lx\n", cp->co_flags ) ;
diff -upk.orig xinetd-2.3.13.orig/xinetd/sensor.c xinetd-2.3.13/xinetd/sensor.c
--- xinetd-2.3.13.orig/xinetd/sensor.c	2003-08-06 06:12:10 +0000
+++ xinetd-2.3.13/xinetd/sensor.c	2005-06-28 16:11:39 +0000
@@ -100,21 +100,22 @@ void process_sensor( const struct servic
 	 {
 	    /* Here again, eh?...update time stamp. */
             char *exp_time;
-	    time_t stored_time;
+	    int stored_time;
 
 	    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 ;
 
-            if ( parse_base10(exp_time, (int *)&stored_time) )
+            if ( parse_base10(exp_time, &stored_time) == 0)
             {  /* if never let them off, bypass */
                if (stored_time != -1)
                {
                   time_t nowtime, new_time;
 
                   nowtime = time(NULL);
-                  new_time = (time_t)nowtime+(60*SC_DENY_TIME(SVC_CONF(sp)));                     if (difftime(new_time, (time_t)stored_time) > 0.0)
+                  new_time = (time_t)nowtime+(60*SC_DENY_TIME(SVC_CONF(sp)));
+		  if (difftime(new_time, (time_t)stored_time) > 0.0)
 	          {   /* new_time is longer save it   */
 		     char time_buf[40], *new_exp_time;
 
@@ -168,12 +169,14 @@ static void scrub_global_access_list( vo
       for (u=0; u < count; u++)
       {
          char *exp_time;
-         time_t stored_time;
+         int stored_time;
 	 
 	 exp_time = pset_pointer( global_no_access_time, u ) ;
-         stored_time = atol(exp_time);
 
-	 if (stored_time == -1)   /* never let them off   */
+	 if (exp_time == NULL)
+	    continue;
+
+	 if (parse_base10(exp_time, &stored_time) || stored_time == -1)   /* never let them off   */
 	    continue;
 
 	 if (difftime(nowtime, (time_t)stored_time) >= 0.0)
diff -upk.orig xinetd-2.3.13.orig/xinetd/util.c xinetd-2.3.13/xinetd/util.c
--- xinetd-2.3.13.orig/xinetd/util.c	2005-04-08 21:23:07 +0000
+++ xinetd-2.3.13/xinetd/util.c	2005-06-28 15:59:44 +0000
@@ -284,6 +284,11 @@ int parse_int(const char *str, int base,
 
 		if (*endptr == term) {
 			*res = strtol_res;
+			if ((long)*res  != strtol_res) {
+				*res = 0;
+				errno = ERANGE;
+				return -1;
+			}
 			return 0;
 		}
 	}
 
design & coding: Vladimir Lettiev aka crux © 2004-2005