libnss-{resolve,myhostname} don’t install correctly if previously removed without being purged

Bug #1649370 reported by Anders Kaseorg on 2016-12-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Medium
Unassigned

Bug Description

# grep hosts /etc/nsswitch.conf
hosts: files myhostname dns
# apt install libnss-resolve
# grep hosts /etc/nsswitch.conf
hosts: files myhostname resolve [!UNAVAIL=return] dns
# apt remove libnss-resolve
# grep hosts /etc/nsswitch.conf
hosts: files myhostname dns
# apt install libnss-resolve
# grep hosts /etc/nsswitch.conf
hosts: files myhostname dns

libnss-resolve.postinst and libnss-myhostname.postinst only update /etc/nsswitch.conf if [ "$1" = configure ] && [ -z "$2" ]. If the package was previously removed but not purged (it is in the Config-Files state), dpkg passes the previous version as $2, so this fails.

Steve Langasek (vorlon) on 2018-01-26
Changed in systemd (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers