Bug 1650 - GSSAPI code can only accept connections for the gethostbyname() name.
Summary: GSSAPI code can only accept connections for the gethostbyname() name.
Status: CLOSED DUPLICATE of bug 928
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Kerberos support (show other bugs)
Version: 5.2p1
Hardware: All All
: P2 enhancement
Assignee: Assigned to nobody
URL:
Keywords: needs-release-note, patch
Depends on:
Blocks:
 
Reported: 2009-09-17 01:45 AEST by Marc Mengel
Modified: 2010-04-16 15:49 AEST (History)
1 user (show)

See Also:


Attachments
Patch to allow a GSS_HOSTNAME environment variable to override gethostname() (572 bytes, patch)
2009-09-17 01:45 AEST, Marc Mengel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Mengel 2009-09-17 01:45:37 AEST
Created attachment 1696 [details]
Patch to allow a GSS_HOSTNAME environment variable to override gethostname()

If  you are on a host with multiple IP addresses that have different
names, users cannot connect via GSSAPI authentication for the 
alternate hostnames.

The attached patch will allow a GSS_HOSTNAME environment variable to
be set which lets an sshd answer to a different hostname than the
one that gethostname() returns.  One can then run an sshd with
this environment variable set and listening to an appropriate
IP address to serve multiple hostnames on one system.
Comment 1 Darren Tucker 2010-01-13 11:14:13 AEDT
Comment on attachment 1696 [details]
Patch to allow a GSS_HOSTNAME environment variable to override gethostname()

I think this is addressed by bug #928 which is targeted (but not yet committed) for the next release.

>+         if (0 != (p = getenv("GSS_HOSTNAME"))) {
>+            strncpy(lname,p,MAXHOSTNAMELEN);

If the environment variable is longer than MAXHOSTNAMELEN then lname will end up unterminated.  You should use strlcpy instead.
Comment 2 Marc Mengel 2010-01-14 03:51:38 AEDT
I agree that the current proposed bug #928 fix would be a better solution.
We should probably mark this as a dup of that bug.  Sorry for missing it in my search.
Comment 3 Darren Tucker 2010-01-14 09:37:33 AEDT
Thanks, closing as duplicate.

If you could test the patch in #928 and add the results to the bug that would help.

*** This bug has been marked as a duplicate of bug 928 ***
Comment 4 Damien Miller 2010-04-16 15:49:54 AEST
Mass move of bugs RESOLVED->CLOSED following the release of openssh-5.5p1