Modifying gethostxxx() under Solaris

Degrande_Samuel Samuel.Degrande at
Mon Mar 17 08:02:22 EST 2003


We are on the way to add Kerberos authentication on our

We have Sun servers, running SEAM (under Solaris9), and we
use it to authenticate NFS access.

In order to use Kerberos authentication with SSH, I
compiled the SSH implementation provided by with
the Kerberos 5 library provided by the MIT. And, as expected,
I have the problem of Sun's gethostbyname() not returning 
FQN hostnames.

Sun's SEAM using FQN, I should then create 2 principals for each
server, host/hostname at REALM and host/hostname.domainname at REALM,
which is not a good solution, I guess.

So, I created a little workaround :
I replaced all calls to gethostbyname(), gethostbyaddr() and
gethostname() in the krb distribution with a call to,
respectively, FQN_gethostbyname(), FQN_gethostbyaddr() and
Those new functions add the DNS default domain when a short
hostname is returned.

I know it's rather an ugly patch, but it solved my problem, 
Kerberos authentication with NFS as well as with SSH using now 
full hostnames.

I just would like to know if there could exist a side effect 
that I didn't already discovered, which could ruin my try to unify 
the two Kerberos distributions that I'm using.


Samuel Degrande           LIFL - UMR 8022 CNRS - Bat M3
Phone: (33)  USTL - Universite de Lille 1

More information about the krbdev mailing list