- Abandoned or dissociated (err condition) leases now remove any related
dynamic dns bindings. Thanks to a patch from Patrick Schoo.
+- Attempting to write a new lease file to replace a corrupt (due to
+ encountering non-retryable errors during writing) lease file should
+ no longer result in an infinite recursion.
+
Changes since 3.0.4rc1
- The dhcp-options.5 manpage was updated to correct indentation errors
#ifndef lint
static char copyright[] =
-"$Id: db.c,v 1.73 2006/06/06 16:35:18 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
+"$Id: db.c,v 1.74 2006/07/19 16:44:47 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
char backfname [512];
TIME t;
int db_fd;
+ int db_validity;
FILE *new_db_file;
/* Make a temporary lease file... */
GET_TIME (&t);
+ 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,
if (errno != 0)
goto fail;
+ /* At this point we have a new lease file that, so far, could not
+ * be described as either corrupt nor valid.
+ */
+ lease_file_is_corrupt = 0;
+
/* Write out all the leases that we know of... */
counting = 0;
if (!write_leases ())
}
counting = 1;
- lease_file_is_corrupt = 0;
return 1;
fail:
- lease_file_is_corrupt = 1;
+ lease_file_is_corrupt = db_validity;
fdfail:
unlink (newfname);
return 0;