lp:~smoser/ubuntu/oneiric/isc-dhcp/lp857524
- Get this branch:
- bzr branch lp:~smoser/ubuntu/oneiric/isc-dhcp/lp857524
Branch merges
- Colin Watson: Approve
-
Diff: 134 lines (+41/-28)2 files modifieddebian/changelog (+6/-0)
debian/dhclient-script.linux (+35/-28)
Related bugs
Bug #857524: dhclient-script will not work with read-only /etc | Undecided | Fix Released |
Related blueprints
Branch information
- Owner:
- Scott Moser
- Status:
- Development
Recent revisions
- 38. By Scott Moser
-
make the population of resolv.conf atomic with a move
This changes the previous commit by:
* re-adding the use of chmod and chown --reference
* using readlink -f to create a temp file to get the full path
to /etc/resolv.conf (in the case it is a symlink)
* creates a temp file in that directory and populates the final
/etc/resolv.conf with a move. - 37. By Scott Moser
-
debian/
dhclient- script. linux: fix for read-only /etc (LP: #857524) fix updating of /etc/resolv.conf for read-only
This makes the following changes:
* instead of writing to a temp file in /etc/, write directly to
/etc/resolv.conf
* replace the multiple '>>' with a single '>' and braces. This means
the file will be opened for write once rather than append many times.
* opening for write (truncate) keeps the ownership of the file if it exists,
and correctly follows a symlink.
This makes the chmod and chown --reference un-necessary
* use 'grep -i' rather than 'sed' to get the old nameserver entries from
existing resolv.conf. This is how the linux.udeb does it, and I find it more
clean.
* changes 'wait_for_rw' to take a file argument rather than hard coding /etc
and then actually tests that that file is writable by opening it for appendNote, there is an issue with this patch if /etc/resolv.conf is a symlink and
is the symlink (*not the target*) is not owned by root. To demonstrate:
$ rm -f /tmp/foo /tmp/bar
$ ln -s /tmp/foo /tmp/bar
$ sudo sh -c 'echo hi > /tmp/foo'
$ sudo sh -c 'echo himom > /tmp/bar'
sh: /tmp/bar: Permission deniedThe only solution I see for this is to attempt to resolve the target of the
symlink (readlink -f) and writing directly there instead of through the
symlink. - 36. By Scott Moser
-
make sure writing of /etc/resolv.conf actually waits until the file is
writable (LP: #856984) - 34. By Colin Watson
-
debian/
dhclient- script. linux.udeb: Leave previous nameservers in
resolv.conf if we don't get any in the current lease (matching the
non-udeb variant). - 32. By Steve Langasek
-
debian/
patches/ dhclient- safer-timeout. dpatch: Increase default
timeout to ensure we don't hit it. Closes LP: #838968.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:ubuntu/oneiric/isc-dhcp