Marius Tomaschewski
479a80499b
features and obsoletes several patches we were using before. For complete list of the changes, please read the RELNOTES file shipped along with the package or online: https://kb.isc.org/article/AA-01297/82/DHCP-4.3.3-Release-Notes.html - Removed obsolete patches included upstream now: [- 0007-dhcp-4.2.6-ldap-mt01.patch, - 0009-dhcp-4.2.6-xen-checksum.patch, - 0013-dhcp-4.2.3-P1-dhclient-log-pid.patch, - 0015-Ignore-SIGPIPE-to-not-die-in-socket-code.patch, - 0016-server-log-DHCPv6-addresses-assigned-to-clients.patch, - 0019-dhcp-4.2.x-ldap-debug-write.bnc835818.patch, - 0021-dhcp-4.2.4-P2-bnc878846-conf-to-ldap.patch, - 0022-dhcp-4.2.x-contrib-conf-to-ldap-reorder.886094.patch, - 0023-dhcp-4.2.x-ddns-tsig-hmac-sha-support.890731.patch, - 0025-dhcp-4.2.x-dhcpv6-retransmission-until-MRD.872609.patch, - 0026-dhcp-4.2.x-disable-unused-ddns-port-in-server.891655.patch] - Replaced hostname patch with a dhcpv6 and fqdn aware variant: [- 0006-dhcp-4.2.5-dhclient-send-hostname-rml.patch, + 0006-dhcp-4.3.2-dhclient-send-hostname-or-fqdn.patch] - Replaced infiniband support patch with fixed variant: [- 0017-dhcp-4.2.6-lpf-ip-over-ib-support.patch - 0018-dhcp-4.2.6-improved-xid.patch - 0027-dhcp-4.2.x-handle-ifa_addr-NULL.909189.patch, + 0030-infiniband-support.patch] - Merged/Adopted patches for the dhcp-4.3.3 sources: [* 0004-dhcp-4.1.1-tmpfile.patch, * 0011-dhcp-4.2.6-close-on-exec.patch, * 0020-dhcp-4.2.x-chown-server-leases.bnc868253.patch] OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=151
38 lines
1.1 KiB
Diff
38 lines
1.1 KiB
Diff
From 70f2683580a88180238804546dd24a6a41427282 Mon Sep 17 00:00:00 2001
|
|
From: Marius Tomaschewski <mt@suse.de>
|
|
Date: Thu, 18 Aug 2011 10:06:01 +0200
|
|
Subject: [PATCH] dhcp-4.1.1-tmpfile
|
|
|
|
Signed-off-by: Marius Tomaschewski <mt@suse.de>
|
|
|
|
diff --git a/server/db.c b/server/db.c
|
|
index 5238ed8..0c642ad 100644
|
|
--- a/server/db.c
|
|
+++ b/server/db.c
|
|
@@ -1116,15 +1116,19 @@ int new_lease_file ()
|
|
* either by malice or ignorance, we panic, since the potential
|
|
* for havoc is high.
|
|
*/
|
|
- if (snprintf (newfname, sizeof newfname, "%s.%d",
|
|
- path_dhcpd_db, (int)t) >= sizeof newfname)
|
|
+ if (snprintf (newfname, sizeof newfname, "%s.XXXXXX",
|
|
+ path_dhcpd_db) >= sizeof newfname)
|
|
log_fatal("new_lease_file: lease file path too long");
|
|
|
|
- db_fd = open (newfname, O_WRONLY | O_TRUNC | O_CREAT, 0664);
|
|
+ db_fd = mkstemp (newfname);
|
|
if (db_fd < 0) {
|
|
log_error ("Can't create new lease file: %m");
|
|
return 0;
|
|
}
|
|
+ if (fchmod(db_fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) == -1) {
|
|
+ log_error ("Can't fchmod new lease file: %m");
|
|
+ goto fail;
|
|
+ }
|
|
|
|
#if defined (PARANOIA)
|
|
/*
|
|
--
|
|
2.1.4
|
|
|