kinit now builds and works on some machines
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@302 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
45
lib/krb5/get_addrs.c
Normal file
45
lib/krb5/get_addrs.c
Normal file
@@ -0,0 +1,45 @@
|
||||
#include "krb5_locl.h"
|
||||
|
||||
static krb5_error_code
|
||||
get_addrs ()
|
||||
{
|
||||
/* here the code from krb4/lib/krb/getaddrs.c will go */
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to get all addresses, but return the one corresponding to
|
||||
* `hostname' if we fail.
|
||||
*/
|
||||
|
||||
krb5_error_code
|
||||
krb5_get_all_client_addrs (krb5_addresses *res)
|
||||
{
|
||||
krb5_error_code err;
|
||||
char hostname[MAXHOSTNAMELEN];
|
||||
struct hostent *hostent;
|
||||
|
||||
if (gethostname (hostname, sizeof(hostname)))
|
||||
return errno;
|
||||
hostent = gethostbyname (hostname);
|
||||
if (hostent == NULL)
|
||||
return errno;
|
||||
res->number = 1;
|
||||
res->addrs = malloc (sizeof(*res->addrs));
|
||||
res->addrs[0].type = hostent->h_addrtype;
|
||||
err = krb5_data_alloc (&res->addrs[0].address, hostent->h_length);
|
||||
if (err)
|
||||
return err;
|
||||
memcpy (res->addrs[0].address.data,
|
||||
hostent->h_addr,
|
||||
hostent->h_length);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Same as above, but with the fall-back to INADDR_ANY.
|
||||
*/
|
||||
|
||||
krb5_error_code
|
||||
krb5_get_all_server_addrs ()
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user