SHA256
1
0
forked from pool/dhcp
dhcp/0004-dhcp-4.1.1-tmpfile.patch
Marius Tomaschewski d059c507b7 - Initially switched to use systemd service files under systemd
and enabled Restart=on-abort (fate#315133).
- Update to ISC dhcp-4.2.6 release. See RELNOTES file for the
  complete list of changes -- digest of fixes not in dhcp-4.2.5:
  - Tidy up receive packet processing.
    Thanks to Brad Plank of GTA for reporting the issue and
    suggesting a possible patch. [ISC-Bugs #34447]
  - Fix the socket handling for DHCPv6 clients to allow multiple
    instances of a client on a single machine to work properly.
    Previously only one client would receive the packets.
    Thanks to Jiri Popelka at Red Hat for the bug report and a
    potential patch. [ISC-Bugs #34784]
  - Added support for gentle shutdown after signal is received.
    [ISC-Bugs #32692] [ISC-Bugs 34945]
  - Enhance the DHCPv6 server logging to include the addresses
    that are assigned to the clients.  This can be enabled by
    defining LOG_V6_ADDRESSES in site.h. [ISC-Bugs #26377]
  - Fix an operation in the DDNS code to be a bitwise instead
    of logical or. [ISC-Bugs #35138]
- Merged patches for dhcp-4.2.6 version to apply without fuzzy,
  prepended patch number prefixes to match spec file patch nr,
  added patch markup tags / bug numbers to the spec file.
- Applied contrib-lease-path pach to contrib.tar.gz
  [- contrib-lease-path.diff]
- Changed to require automake and use its config.sub and guess
  files instead of maintaining a patch.
  [- config-guess-sub-update.patch]
- Enabled to log DHCPv6 addresses assigned by server to clients
  [+ 0016-server-log-DHCPv6-addresses-assigned-to-clients.patch]
- Cleaned up documentation, rpmlint adjustments.

OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=121
2014-02-10 18:14:12 +00:00

45 lines
1.4 KiB
Diff

From 1638d046d2a914164e19c6244df5b4deadaf6938 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
---
server/db.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/server/db.c b/server/db.c
index 82f3841..c2630ea 100644
--- a/server/db.c
+++ b/server/db.c
@@ -1088,21 +1088,16 @@ int new_lease_file ()
db_validity = lease_file_is_corrupt;
- /* %Audit% Truncated filename causes panic. %2004.06.17,Safe%
- * This should never happen since the path is a configuration
- * variable from build-time or command-line. But if it should,
- * 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)
- log_fatal("new_lease_file: lease file path too long");
-
- db_fd = open (newfname, O_WRONLY | O_TRUNC | O_CREAT, 0664);
+ snprintf (newfname, sizeof(newfname), "%s.XXXXXX", path_dhcpd_db);
+ 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 ((new_db_file = fdopen(db_fd, "w")) == NULL) {
log_error("Can't fdopen new lease file: %m");
close(db_fd);
--
1.8.4