From 3ee1daf8e607568f705a13b859db79df3dcb285a Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 19 Jul 2001 14:03:13 +0000 Subject: [PATCH] * klist.c (one_addr): Pass UNIX address family, not Kerberos address type, to inet_ntop. Print different messages for unknown address types and known address types we don't know how to print (e.g., AF_INET6 without inet_ntop). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13616 dc483132-0cff-0310-8789-dd5450dbe970 --- src/clients/klist/ChangeLog | 7 +++++++ src/clients/klist/klist.c | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/clients/klist/ChangeLog b/src/clients/klist/ChangeLog index eb29aad85..03608a2ab 100644 --- a/src/clients/klist/ChangeLog +++ b/src/clients/klist/ChangeLog @@ -1,3 +1,10 @@ +2001-07-19 Ken Raeburn + + * klist.c (one_addr): Pass UNIX address family, not Kerberos + address type, to inet_ntop. Print different messages for unknown + address types and known address types we don't know how to print + (e.g., AF_INET6 without inet_ntop). + 2001-06-08 Ezra Peisach * klist.c: Include unistd.h (if present) for getopt() prototype. diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c index 7d95feb63..9bae5dda3 100644 --- a/src/clients/klist/klist.c +++ b/src/clients/klist/klist.c @@ -652,7 +652,7 @@ show_credential(cred) void one_addr(a) krb5_address *a; { - struct hostent *h; + struct hostent *h = 0; if ((a->addrtype == ADDRTYPE_INET && a->length == 4) #ifdef AF_INET6 @@ -674,7 +674,7 @@ void one_addr(a) if (no_resolve || !h) { #ifdef HAVE_INET_NTOP char buf[46]; - const char *name = inet_ntop(a->addrtype, a->contents, buf, sizeof(buf)); + const char *name = inet_ntop(af, a->contents, buf, sizeof(buf)); if (name) { printf ("%s", name); return; @@ -686,6 +686,8 @@ void one_addr(a) return; } #endif + printf("unprintable address (type %d)", a->addrtype); + return; } } printf("unknown addr type %d", a->addrtype); -- 2.26.2