rpms/rdate/devel rdate-1.4-addrinfo.patch, NONE, 1.1 rdate.spec, 1.24, 1.25

Jiří Moskovčák (jmoskovc) fedora-extras-commits at redhat.com
Mon Mar 31 12:33:37 UTC 2008


Author: jmoskovc

Update of /cvs/extras/rpms/rdate/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8654

Modified Files:
	rdate.spec 
Added Files:
	rdate-1.4-addrinfo.patch 
Log Message:
Fixed early freeing of addrinfo.


rdate-1.4-addrinfo.patch:

--- NEW FILE rdate-1.4-addrinfo.patch ---
--- rdate-1.4/rdate.c.inet6	2004-04-21 19:44:22.000000000 +0100
+++ rdate-1.4/rdate.c	2008-03-07 17:28:52.000000000 +0000
@@ -144,7 +144,6 @@ rdate(const char *hostname, time_t *retv
 		  break;
 	  }
   }
-  freeaddrinfo(res0);
   if (err < 0) {
 	  writeLog(1, "couldn't create socket: %s", strerror(errno));
 	  return -1;
@@ -160,6 +159,9 @@ rdate(const char *hostname, time_t *retv
       {
         writeLog(1, "couldn't connect to host %s: %s", hostname, strerror(errno));
         close(fd);
+#ifdef INET6
+	freeaddrinfo(res0);
+#endif
         return -1;
       }
 
@@ -172,6 +174,9 @@ rdate(const char *hostname, time_t *retv
         else
 	  writeLog(1, "got EOF from time server");
         close(fd);
+#ifdef INET6
+	freeaddrinfo(res0);
+#endif
 
         return -1;
       }
@@ -183,6 +188,9 @@ rdate(const char *hostname, time_t *retv
 #endif
       writeLog(1, "couldn't send UDP message to host %s: %s", hostname, strerror(errno));
       close(fd);
+#ifdef INET6
+	freeaddrinfo(res0);
+#endif
       return -1;
     }
 
@@ -197,11 +205,17 @@ rdate(const char *hostname, time_t *retv
       else
 	writeLog(1, "got EOF from time server");
       close(fd);
+#ifdef INET6
+	freeaddrinfo(res0);
+#endif
       return -1;
     }
   }
 
   close(fd);
+#ifdef INET6
+  freeaddrinfo(res0);
+#endif
   
   /* See inetd's builtins.c for an explanation */
   *retval = (time_t)(ntohl(*(uint32_t *)time_buf) - 2208988800UL);


Index: rdate.spec
===================================================================
RCS file: /cvs/extras/rpms/rdate/devel/rdate.spec,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- rdate.spec	19 Feb 2008 06:35:12 -0000	1.24
+++ rdate.spec	31 Mar 2008 12:32:59 -0000	1.25
@@ -1,11 +1,12 @@
 Summary: Tool for getting the date/time from a remote machine
 Name: rdate
 Version: 1.4
-Release: 10%{?dist}
+Release: 11%{?dist}
 License: GPL
 Group: Applications/System
 Source: ftp://people.redhat.com/sopwith/rdate-%{version}.tar.gz
 Patch0: rdate-1.4-udp.patch
+Patch1: rdate-1.4-addrinfo.patch
 URL: ftp://people.redhat.com/sopwith/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -18,6 +19,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -DINET6"
@@ -37,6 +39,9 @@
 %{_mandir}/man1/rdate.1*
 
 %changelog
+* Mon Mar 31 2008 Jiri Moskovcak <jmoskovc at redhat.com> - 1.4-11
+- fixed early freeing of addrinfo
+
 * Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 1.4-10
 - Autorebuild for GCC 4.3
 




More information about the fedora-extras-commits mailing list