[Bug 3510] New: host name lookup quirk

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Tue Dec 13 00:47:11 AEDT 2022


https://bugzilla.mindrot.org/show_bug.cgi?id=3510

            Bug ID: 3510
           Summary: host name lookup quirk
           Product: Portable OpenSSH
           Version: 9.1p1
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: thomas at koeller.dyndns.org

Setting up hostbased authentication I noticed a difference in treatment
of the requesting client's host name, depending on whether the
connection is via ipv4 or ipv6. In the ipv6 case, the client's fqdn is
looked up in /etc/shosts as documented, while in the ipv4 case the
client's unadorned host name is used.

After some debugging I found that the apparently the getnameinfo()
function, which is used by the client to retrieve its own host name, is
responsible. It seems that calling this function with the 'flags'
argument set to 'NI_NAMERQD' returns the fqdn for an ipv6 socket, but
for ipv4 it returns just the plain host name without a domain part.

Now, an obvious, easy workaround for this problem is to have both names
in /etc/shosts, but that is certainly undesirable. I wonder if there is
a better workaround?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list