Commit 05f76dab authored by Simon Kelley's avatar Simon Kelley

Don't die() on failing to parse lease-script output.

parent bf05f8ff
...@@ -133,7 +133,6 @@ static int read_leases(time_t now, FILE *leasestream) ...@@ -133,7 +133,6 @@ static int read_leases(time_t now, FILE *leasestream)
void lease_init(time_t now) void lease_init(time_t now)
{ {
FILE *leasestream; FILE *leasestream;
int readok = 0;
leases_left = daemon->dhcp_max; leases_left = daemon->dhcp_max;
...@@ -172,7 +171,7 @@ void lease_init(time_t now) ...@@ -172,7 +171,7 @@ void lease_init(time_t now)
if (leasestream) if (leasestream)
{ {
if (!(readok = read_leases(now, leasestream))) if (!read_leases(now, leasestream))
my_syslog(MS_DHCP | LOG_ERR, _("failed to parse lease database, invalid line: %s %s %s %s ..."), my_syslog(MS_DHCP | LOG_ERR, _("failed to parse lease database, invalid line: %s %s %s %s ..."),
daemon->dhcp_buff3, daemon->dhcp_buff2, daemon->dhcp_buff3, daemon->dhcp_buff2,
daemon->namebuff, daemon->dhcp_buff); daemon->namebuff, daemon->dhcp_buff);
...@@ -202,12 +201,6 @@ void lease_init(time_t now) ...@@ -202,12 +201,6 @@ void lease_init(time_t now)
sprintf(daemon->dhcp_buff, "%d", WEXITSTATUS(rc)); sprintf(daemon->dhcp_buff, "%d", WEXITSTATUS(rc));
die(_("lease-init script returned exit code %s"), daemon->dhcp_buff, WEXITSTATUS(rc) + EC_INIT_OFFSET); die(_("lease-init script returned exit code %s"), daemon->dhcp_buff, WEXITSTATUS(rc) + EC_INIT_OFFSET);
} }
/* Only die if we stopped reading due to a non-parsed line when running script,
this is expected behaviour when reading from a file, if the file was written with IPv6 data
and we are not compiled to understand that. */
if (!readok)
die(_("failed to read lease-init script output"), NULL, EC_FILE);
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment