Save hostname.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4770 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1998-04-17 22:30:59 +00:00
parent 2266ffcefc
commit 69aeb9602b

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan * Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -54,6 +54,7 @@ krb5_sock_to_principal (krb5_context context,
struct sockaddr *sa; struct sockaddr *sa;
struct hostent *hostent; struct hostent *hostent;
int family; int family;
char hname[256];
if (buf == NULL) if (buf == NULL)
return ENOMEM; return ENOMEM;
@@ -76,8 +77,9 @@ krb5_sock_to_principal (krb5_context context,
if (hostent == NULL) if (hostent == NULL)
return h_errno; return h_errno;
strcpy_truncate(hname, hostent->h_name, sizeof(hname));
return krb5_sname_to_principal (context, return krb5_sname_to_principal (context,
hostent->h_name, hname,
sname, sname,
type, type,
ret_princ); ret_princ);