From ffc8491b493809fd197c85bb22a5686162cebaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 25 Jan 2009 01:01:46 +0000 Subject: [PATCH] print aliases if there is any git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24471 ec53bebd-3082-4978-b11e-865c3cabbd6b --- admin/list.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/admin/list.c b/admin/list.c index 60b323eb7..72eccfc2a 100644 --- a/admin/list.c +++ b/admin/list.c @@ -85,6 +85,7 @@ do_list(struct list_options *opt, const char *keytab_str) rtbl_add_column_by_id(table, 3, "Date", 0); if(opt->keys_flag) rtbl_add_column_by_id(table, 4, "Key", 0); + rtbl_add_column_by_id(table, 5, "Aliases", 0); rtbl_set_separator(table, " "); while((ret = krb5_kt_next_entry(context, keytab, &entry, &cursor)) == 0){ @@ -125,6 +126,19 @@ do_list(struct list_options *opt, const char *keytab_str) rtbl_add_column_entry_by_id(table, 4, s); free(s); } + if (entry.aliases) { + unsigned int i; + struct rk_strpool *p = NULL; + + for (i = 0; i< entry.aliases->len; i++) { + krb5_unparse_name_fixed(context, entry.principal, buf, sizeof(buf)); + rk_strpoolprintf(p, "%s%s", buf, + i + 1 < entry.aliases->len ? ", " : ""); + + } + rtbl_add_column_entry_by_id(table, 5, rk_strpoolcollect(p)); + } + krb5_kt_free_entry(context, &entry); } ret = krb5_kt_end_seq_get(context, keytab, &cursor);