dhclient prevents itself from accessing its own leases file

Bug #26645 reported by David Riebenbauer
14
Affects Status Importance Assigned to Milestone
Ubuntu
Fix Released
Medium
Unassigned
dhcp3 (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

I have my eth0 in /etc/network/interfaces configured to get it's information from
dhcp. This results in dhclient to be tun as root.

Ubuntu's version of dhcp3-client apparently has a patch applied that changes the
user and group to dhcp:dhcp after the lease has been obtained and the leases file
has been written. Unfortunatly dhclient will not be able to update the leases file
when the lease is refreshed, because only root has the right to do that and dhclient
has droppped it's privileges.

As a result the message:

"localhost dhclient: can't create /var/run/dhclient.eth0.leases:
+Permission denied" appears in syslog and the leases file is not rewritten

Revision history for this message
David Riebenbauer (davrieb) wrote :

Created an attachment (id=5200)
dpatch to fix wrong permisions of leases file

this patch chowns the leases file before dhclient drops it's privileges

Revision history for this message
Martin Pitt (pitti) wrote :

This has already been fixed some weeks ago in

dhcp3 (3.0.3-5ubuntu3) dapper; urgency=low

  * debian/patches/deroot-client.dpatch:
    - rewrite_client_leases(): Truncate and rewind the leases file instead of
      closing and reopening it. The latter is not possible any more with
      dropped root privileges.
    - See bug #24292 (which has a different cause, but led to discovering this
      one).

Revision history for this message
kvdb (kc0) wrote :

Please also apply this patch to the dhcp3-client package in breezy, in which the same issue is (still) present.

Revision history for this message
Martin Pitt (pitti) wrote : breezy-updates interdiff

Fixed package prepared, pending approval:

 dhcp3 (3.0.2-1ubuntu7) breezy-updates; urgency=low
 .
   * debian/patches/deroot-client.dpatch:
     - rewrite_client_leases(): Truncate and rewind the leases file instead of
       closing and reopening it. The latter is not possible any more with
       dropped root privileges.
     - Fix taken from Dapper version 3.0.3-5ubuntu3.
     - Malone #26645

Revision history for this message
Matt Zimmerman (mdz) wrote :

OK for breezy-updates

Revision history for this message
Martin Pitt (pitti) wrote :

Breezy-updates package was uploaded, pending upload processing now.

Revision history for this message
Colin Watson (cjwatson) wrote :

Accepted for breezy-updates.

Revision history for this message
Martin Pitt (pitti) wrote :

Package has been released. Enjoy!

Revision history for this message
Chris Wagner (chris-wagner) wrote :

Sorry, I accidentally hit that button that says "Yes, I want to report this bug in Ubuntu".

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.