#440200 dhcp-client leases file incorrect error handling

#440200#5
Date:
2007-08-30 16:22:42 UTC
From:
To:
Following some testing I was reviewing the code in dhcp3-client which
handles the client leases file, and based on my inspection of the code
I think there are bugs in the error handling of writes to this file.

 * write_client_lease assumes that errno will only be set nonzero by
   failed writes.  This is not guaranteed; you _are_ guaranteed that
   errno will be set if an error occurs but you're _not_ guaranteed
   that successful calls to libc functions do not set errno.

 * write_client_lease is capable of writing corrupt lease
   records if some but not all of the fprintfs fail.  In particular,
   if an earlier fprintf fails but a later one success (for example
   because the disk is full for the first write and not for the
   second) then the file could contain syntax errors or even incorrect
   information.  The code in dhcp3-client should abandon the efforts to
   write more text if any prior write fails.  If any write fails then
   the next update must be done with rewrite_client_leases since the
   exact contents of the old leases file are not known.

 * rewrite_client_leases should write the new leases file out to a
   temporary file and use rename(2) to install it.  This will ensure
   that in case of write errors at least the previous file is
   preserved.

I imagine that there are similar mistakes in other parts of the dhcp3
source.

Ian.

#440200#8
Date:
2008-01-12 06:43:37 UTC
From:
To:
Hello,

This bug was filed a while ago, but it's really not a packaging issue, so
I'm forwarding it upstream to you.

Please maintain the Cc line for any replies so that our bug tracking system
is kept in the loop.

regards

Andrew
----- Forwarded message from Ian Jackson <iwj@ubuntu.com> ----- From: Ian Jackson <iwj@ubuntu.com> To: submit@bugs.debian.org Subject: Bug#440200: dhcp-client leases file incorrect error handling Date: Thu, 30 Aug 2007 17:22:42 +0100 X-Mailer: VM 7.03 under Emacs 19.34.1 Package: dhcp3 Version:3.0.6-1 Following some testing I was reviewing the code in dhcp3-client which handles the client leases file, and based on my inspection of the code I think there are bugs in the error handling of writes to this file. * write_client_lease assumes that errno will only be set nonzero by failed writes. This is not guaranteed; you _are_ guaranteed that errno will be set if an error occurs but you're _not_ guaranteed that successful calls to libc functions do not set errno. * write_client_lease is capable of writing corrupt lease records if some but not all of the fprintfs fail. In particular, if an earlier fprintf fails but a later one success (for example because the disk is full for the first write and not for the second) then the file could contain syntax errors or even incorrect information. The code in dhcp3-client should abandon the efforts to write more text if any prior write fails. If any write fails then the next update must be done with rewrite_client_leases since the exact contents of the old leases file are not known. * rewrite_client_leases should write the new leases file out to a temporary file and use rename(2) to install it. This will ensure that in case of write errors at least the previous file is preserved. I imagine that there are similar mistakes in other parts of the dhcp3 source. Ian.
----- End forwarded message -----
#440200#21
Date:
2026-08-05 17:31:09 UTC
From:
To:
Dear submitter,

as the package isc-dhcp has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1143544

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Thorsten Alteholz (the ftpmaster behind the curtain)