Bug 1777873 - libvirt_guest NSS module should also map lowercase VM name
Summary: libvirt_guest NSS module should also map lowercase VM name
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2019-11-28 14:43 UTC by Pieter Hollants
Modified: 2021-04-25 07:45 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:

Attachments (Terms of Use)

Description Pieter Hollants 2019-11-28 14:43:56 UTC
Description of problem:
If the libvirt_guest NSS module is configured in /etc/nsswitch.conf to provide hostname -> IP mapping _and_ a VM name is used that is not all lowercase, the mapping will fail when used with e.g. "ssh" because it automatically lowercases hostnames and libvirt_guest maps the original case only.

Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. Configure /etc/nsswitch.conf to use "libvirt_guest" for "hosts" lookups
2. Define and start am VM with a uppercase name such as "FooBar" connected to the NATed "default" network
3. Verify VM is running with "virsh -c qemu:///system list"
4. Verify expected lease with "virsh -c qemu:///system net-dhcp-leases default"
5. "ssh -v FooBar"

Actual results:
"ssh -v FooBar" will fail and show that connecting fails because the actual lookup is done on "foobar" for which "getent hosts foobar" does not provide a host -> IP mapping as NSS lookups are case-sensitive.

Expected results:
Either libvirt_guest should also add lower-cased host -> IP mapping so that "getent hosts foobar" and thus "ssh -v FooBar" work _or_ the documentation at https://libvirt.org/nss.html should be updated that libvirt_guest explictly works with all lower-cased VM names only.

Note You need to log in before you can comment on or make changes to this bug.