diff options
author | gibbs <gibbs@FreeBSD.org> | 1995-10-05 21:30:21 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1995-10-05 21:30:21 +0000 |
commit | 2734551417f3e16093c4cc8de51248dd743fa17b (patch) | |
tree | 9410ca0cafe506eca75c35934448a29ad19a6482 /eBones/lib/librkinit | |
parent | 73c29c06751229bf5749b8422047cf613fb47bbc (diff) | |
download | FreeBSD-src-2734551417f3e16093c4cc8de51248dd743fa17b.zip FreeBSD-src-2734551417f3e16093c4cc8de51248dd743fa17b.tar.gz |
Kerberos can now deal with multi-homed clients.
Kerberos obtains a network address for the local host from the routing
tables and uses it consistently for all Kerberos transactions. This ensures
that packets only leave the *authenticated* interface. Clients who open
and use their own sockets for encrypted or authenticated correspondance
to kerberos services should bind their sockets to the same address as that
used by kerberos. krb_get_local_addr() and krb_bind_local_addr() allow
clients to obtain the local address or bind a socket to the local address
used by Kerberos respectively.
Reviewed by: Mark Murray <markm>, Garrett Wollman <wollman>
Obtained from: concept by Dieter Dworkin Muller <dworkin@village.org>
Diffstat (limited to 'eBones/lib/librkinit')
-rw-r--r-- | eBones/lib/librkinit/rk_rpc.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/eBones/lib/librkinit/rk_rpc.c b/eBones/lib/librkinit/rk_rpc.c index dd61327..d931899 100644 --- a/eBones/lib/librkinit/rk_rpc.c +++ b/eBones/lib/librkinit/rk_rpc.c @@ -1,7 +1,7 @@ /* - * $Id: rk_rpc.c,v 1.1 1993/12/10 19:36:09 dglo Exp gibbs $ - * $Source: /usr/src/eBones/librkinit/RCS/rk_rpc.c,v $ - * $Author: dglo $ + * $Id: rk_rpc.c,v 1.1.1.1 1995/09/15 06:09:30 gibbs Exp $ + * $Source: /home/ncvs/src/eBones/lib/librkinit/rk_rpc.c,v $ + * $Author: gibbs $ * * This file contains functions that are used for network communication. * See the comment at the top of rk_lib.c for a description of the naming @@ -9,7 +9,7 @@ */ #if !defined(lint) && !defined(SABER) && !defined(LOCORE) && defined(RCS_HDRS) -static char *rcsid = "$Id: rk_rpc.c,v 1.1 1993/12/10 19:36:09 dglo Exp gibbs $"; +static char *rcsid = "$Id: rk_rpc.c,v 1.1.1.1 1995/09/15 06:09:30 gibbs Exp $"; #endif /* lint || SABER || LOCORE || RCS_HDRS */ #include <stdio.h> @@ -187,7 +187,7 @@ int rki_setup_rpc(host) { struct hostent *hp; struct servent *sp; - int port; + int port, retval; SBCLEAR(saddr); SBCLEAR(hp); @@ -214,7 +214,12 @@ int rki_setup_rpc(host) rkinit_errmsg(errbuf); return(RKINIT_SOCKET); } - + if ((retval = krb_bind_local_addr(sock)) != KSUCCESS) { + sprintf(errbuf, "krb_bind_local_addr: %s", krb_err_txt[retval]); + rkinit_errmsg(errbuf); + close(sock); + return(RKINIT_SOCKET); + } if (connect(sock, (struct sockaddr *)&saddr, sizeof (saddr)) < 0) { sprintf(errbuf, "connect: %s", sys_errlist[errno]); rkinit_errmsg(errbuf); |