HomeClusterLabs Projects

Medium: exportfs: Use canonical hostname for monitor
2b6dbd95e982Unpublished

Unpublished Commit ยท Learn More

  • Repository Importing: This repository is still importing.
  • Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Medium: exportfs: Use canonical hostname for monitor

If the hostname specified in clientspec does not match the canonical
hostname, the monitor operation fails even though the export exists.

This is caused by the exportfs command's name resolution process. It
queries the hosts DB as configured in /etc/nsswitch.conf (usually
/etc/hosts and/or DNS) to ensure that the given hostname resolves.

If the lookup returns the FQDN and the clientspec uses the short name,
the monitor operation fails. This also occurs in reverse. If the lookup
returns the short name and the clientspec uses the FQDN, the monitor
operation fails.

This patch resolves the issue by querying the ahosts database to fetch
the canonical hostname. We use the canonical hostname as the spec. If
the clientspec is an IP address, the fetch simply returns the same IP
address. If the clientspec is of some other format, the fetch returns
nothing and we continue to use the spec as-is.

Using getent ahosts rather than getent hosts eliminates the need to
handle IP addresses specially, thanks to its output formatting. It uses
getaddrinfo rather than gethostbyname2.

Details

Provenance
Reid Wahl <nwahl@redhat.com>Authored on Sep 28 2018, 5:27 AM
Parents
rRc92e8c84b73d: nfsserver: only mount rpc_pipefs if it's not mounted
Branches
Unknown
Tags
Unknown

Event Timeline