rpms/dhcpv6/F-7 dhcpv6-0.10-init_leases.patch, NONE, 1.1 dhcpv6.spec, 1.56, 1.57

David Cantrell (dcantrel) fedora-extras-commits at redhat.com
Tue Sep 4 17:59:43 UTC 2007


Author: dcantrel

Update of /cvs/pkgs/rpms/dhcpv6/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16946

Modified Files:
	dhcpv6.spec 
Added Files:
	dhcpv6-0.10-init_leases.patch 
Log Message:
* Tue Sep 04 2007 David Cantrell <dcantrell at redhat.com> - 0.10-43
- Do not parse an empty /var/lib/dhcpv6/server6.leases file (#253968)


dhcpv6-0.10-init_leases.patch:

--- NEW FILE dhcpv6-0.10-init_leases.patch ---
diff -up dhcp-0.10/lease.c.init_leases dhcp-0.10/lease.c
--- dhcp-0.10/lease.c.init_leases	2007-09-04 12:25:35.000000000 -0400
+++ dhcp-0.10/lease.c	2007-09-04 13:48:44.000000000 -0400
@@ -180,18 +180,25 @@ FILE *
 init_leases(const char *name)
 {
 	FILE *file;
+	struct stat stbuf;
 	file = fopen(name, "a+");
 	if(!file) {
 		dprintf(LOG_ERR, "%s" "could not open lease file", FNAME);
 		return (NULL);
 	}
+	if (!lstat(file, &stbuf)) {
+		dprintf(LOG_ERR, "%s" "could not stat lease file", FNAME);
+		return (NULL);
+	}
 	if (dhcp6_mode == DHCP6_MODE_SERVER) {
 		if (0 != init_lease_hashes()) {
 			dprintf(LOG_ERR, "%s" "Could not initialize hash arrays", FNAME);
 			return (NULL);
 		}
 	}
-	lease_parse(file);
+	if (stbuf.st_size > 0 ) {
+		lease_parse(file);
+	}
 	return file;
 } 
 


Index: dhcpv6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/dhcpv6/F-7/dhcpv6.spec,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- dhcpv6.spec	2 Aug 2007 19:15:37 -0000	1.56
+++ dhcpv6.spec	4 Sep 2007 17:59:11 -0000	1.57
@@ -1,7 +1,7 @@
 Summary: DHCPv6 - DHCP server and client for IPv6
 Name:    dhcpv6
 Version: 0.10
-Release: 42%{?dist}
+Release: 43%{?dist}
 License: BSD
 Group:   System Environment/Daemons
 URL:     http://dhcpv6.sourceforge.net/
@@ -16,6 +16,7 @@
 Patch4:  %{name}-0.10-no-strlcat.patch
 Patch5:  %{name}-0.10-salen.patch
 Patch6:  %{name}-0.10-initscripts.patch
+Patch7:  %{name}-0.10-init_leases.patch
 
 Patch99: %{name}-0.10-libdhcp6client.patch
 
@@ -68,6 +69,7 @@
 %patch4 -p1 -b .no_strlcat
 %patch5 -p1 -b .salen
 %patch6 -p1 -b .initscripts
+%patch7 -p1 -b .init_leases
 
 %patch99 -p1 -b .libdhcp6client
 
@@ -160,6 +162,9 @@
 %{_libdir}/libdhcp6client.a
 
 %changelog
+* Tue Sep 04 2007 David Cantrell <dcantrell at redhat.com> - 0.10-43
+- Do not parse an empty /var/lib/dhcpv6/server6.leases file (#253968)
+
 * Thu Apr 26 2007 David Cantrell <dcantrell at redhat.com> - 0.10-42
 - Init script fixes (#237973)
 




More information about the fedora-extras-commits mailing list