libnss-libvirt does not include libnss_libvirt_guest.so for nsswitch

Bug #1853074 reported by Rafael David Tinoco
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Medium
Unassigned
Disco
Fix Released
Medium
Unassigned
Eoan
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * Despite libvirt having been compiled with libnss_libvirt_guest support,
   it only includes libnss_libvirt.so.2 shared library. With that, one
   that would like to use "libvirt_guest" as an entry in
   /etc/nsswitch.conf, to resolve hostnames (being the same as the virtual
   machine names) won't be able to.

[Test Case]

 * Create a virtual machine called "test-guestname" with hostname
   "test-hostname"
   it is important that guestname and hostname differ.
 * Make sure this virtual machine is attached to "default" network
   (Default config)
 * Make sure the "default" network offers DHCP addresses
   (Default config)
 * Edit /etc/nsswitch.conf:
   ...
   # mode to resolve hostnames
   hosts: files libvirt dns
   ...
 * Confirm you're able to resolve "test-hostname": ping untested
 * Edit /etc/nsswitch.conf and change to:
   ...
   # mode to resolve guestnames
   hosts: files libvirt_guest dns
   ...
 * You won't be able to resolve "test-guestname" (virtual machine name)
 * With the fix installed the latter will work as well

[Regression Potential]

 * This change only includes a missing shared library in package libnss-
   libvirt package. No code change: regressions could happen during
   package building most likely. One might think "oh due to the install
   now names will resolve differently", but they are not as the lib is not
   used until you change nsswitch.conf as outlined above.

[Other Info]

Following the guidelines at:

https://libvirt.org/nss.html

I realized that we should be including libnss_libvirt.so.2 (as we are) and ALSO libnss_libvirt_guest.so.2 (not included) in the libnss-libvirt package.

With that file missing, we can't solve libvirt machine names when changing nsswitch.conf "hosts" entry to "libvirt_guest" and we rely only in solving the guest hostname with "libvirt" only.

Related branches

Changed in libvirt (Ubuntu Disco):
status: New → Confirmed
importance: Undecided → Medium
Changed in libvirt (Ubuntu Bionic):
status: New → Confirmed
importance: Undecided → High
importance: High → Medium
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

It was fixed in:

  * [447dd58] libnss-libvirt: Install libnss_libvirt-guest as well
    (Closes: #910288)

upstream:

libvirt (5.2.0-2) experimental; urgency=medium

  [ Guido Günther ]
  * [1ec90c0] d/compat: Switch to debhelper level 12
      * [fb6dd18] d/rules: s/no-restart-on-upgrade/no-stop-on-upgrade/
      * [3764b71] d/rules: --prallel not needed anymore
      * [1d92095] d/control: Add ${misc:Pre-Depends} for
        libvirt-daemon-system. This makes sure we pull in recent enough
        init-system-helpers
  * [02a155b] d/rules: Switch to dh_installsystemd
    dh_systemd_start is no longer used.
  * [bcad111] d/control: Fix typo
  * [8609192] d/control: Drop Debian revision on iptables build-dep. Any
    version greater than 1.8.1 will do.
  * [447dd58] libnss-libvirt: Install libnss_libvirt-guest as well
    (Closes: #910288)
  * [4fb7d11] d/control: Build-depend on libglusterfs-dev.
    Since this is a recent addition we can drop the versioned dependency.
    (Closes: #919663)
  * [7b4ffeb] d/rules: Newer debhelper puts the libs into multi arch dirs.
    There's no need to move them manually anymore.

  [ Andrea Bolognani ]
  * [dd9cdaa] Use HTTPS for all URLs.
    This gets rid of the debian-watch-uses-insecure-uri informational Lintian
    tag, and then some.
  * [faaec12] Minimize upstream's signing key.
    This gets rid of the public-upstream-key-not-minimal informational Lintian
    tag.
  * [8a0e6f1] Remove Priority field from binary packages.
    This gets rid of the binary-control-field-duplicates-source informational
    Lintian tag.

  [ Christian Ehrhardt ]
  * [08f3a23] d/libvirt-clients.manpages: add virkeycode and virkeyname man
    pages.
  * [0f359de] d/rules: mv logrotate files to silence dh_missing
  * [f36ca33] dh_missing: ignore warning on libtool .la file

Changed in libvirt (Ubuntu Eoan):
status: New → Fix Released
Changed in libvirt (Ubuntu Focal):
status: New → Fix Released
description: updated
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Ill send the MRs tomorrow as it looks like launchpad git repos are having some issues currently.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I think the git issues were a scheduled maintenance right?
Anyway, while this is borderline between bug/feature I agree that it should have very low regression potential and OTOH will help people.

So +1 on going forward with that.

description: updated
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Slightly improved the SRU template, leaving the rest to you as you might have a local branch already ...

description: updated
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Scheduled maintenance + a bad timing for repositories deletion. Launchpad team is already working on it, I'll merge my fixes as soon as they finish fixing my repos. Thx for the SRU template change.

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Rafael, or anyone else affected,

Accepted libvirt into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libvirt/5.0.0-1ubuntu2.6 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in libvirt (Ubuntu Disco):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-disco
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Rafael, or anyone else affected,

Accepted libvirt into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libvirt/4.0.0-1ubuntu8.14 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in libvirt (Ubuntu Bionic):
status: Confirmed → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (libvirt/4.0.0-1ubuntu8.14)

All autopkgtests for the newly accepted libvirt (4.0.0-1ubuntu8.14) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

debci/unknown (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#libvirt

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

If one wants to recreate please be reminded that cloud-init will override the hostname in most default setups unless you set /etc/cloud/cloud.cfg to have
preserve_hostname: true

libnss-libvirt non-installed
- none (but no crashes/failures)

libnss-libvirt installed
- hostname can resolves
- guestname can't resolve

Update libnss-libvirt from -proposed
- hostname and guestname can resolve

I used a combined config like:
hosts: files libvirt libvirt_guest dns

tags: added: verification-done verification-done-bionic verification-done-disco
removed: verification-needed verification-needed-bionic verification-needed-disco
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Please be sure to always include the version number of the packages tested during verification - this is required for the verification to be valid. That being said, I trust that you have used the right packages this time, so I'll proceed with the release.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libvirt - 5.0.0-1ubuntu2.6

---------------
libvirt (5.0.0-1ubuntu2.6) disco; urgency=medium

  * debian/rules: libnss-libvirt: Install libnss_libvirt_guest (LP: #1853074)

 -- Rafael David Tinoco <email address hidden> Tue, 19 Nov 2019 00:56:29 +0000

Changed in libvirt (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for libvirt has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libvirt - 4.0.0-1ubuntu8.14

---------------
libvirt (4.0.0-1ubuntu8.14) bionic; urgency=medium

  * debian/rules: libnss-libvirt: Install libnss_libvirt_guest (LP: #1853074)

 -- Rafael David Tinoco <email address hidden> Wed, 20 Nov 2019 11:52:51 +0000

Changed in libvirt (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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