Only set PAM_RHOST if the remote host is not "UNKNOWN"
When using sshd's -i option with stdio that is not a AF_INET/AF_INET6 socket, auth_get_canonical_hostname() returns "UNKNOWN" which is then set as the value of PAM_RHOST, causing pam to try to do a reverse DNS query of "UNKNOWN", which times out multiple times, causing a substantial slowdown when logging in.
To fix this, let's only set PAM_RHOST if the hostname is not "UNKNOWN".
@djmdjm @daztucker Could any of you take a look at this PR? I'd very much like to see this fixed and setting PAM_RHOST when we don't know it seems like a bug to me.
Ping @djmdjm @daztucker
Ping @djmdjm @daztucker could you please have a look.