diff options
| author | Greg Hudson <ghudson@mit.edu> | 2009-10-09 18:29:34 +0000 |
|---|---|---|
| committer | Greg Hudson <ghudson@mit.edu> | 2009-10-09 18:29:34 +0000 |
| commit | 17ffdd0e93271072369e479f440ddf85e020580a (patch) | |
| tree | cdaf4944a478128a1d53d854063a7d809b7c6aae /src/clients/klist | |
| parent | 6ad74ac369b09df7d29ca8e09b0af946b4819523 (diff) | |
| download | krb5-17ffdd0e93271072369e479f440ddf85e020580a.tar.gz krb5-17ffdd0e93271072369e479f440ddf85e020580a.tar.xz krb5-17ffdd0e93271072369e479f440ddf85e020580a.zip | |
Implement GSS naming extensions and authdata verification
Merge Luke's users/lhoward/authdata branch to trunk. Implements GSS naming
extensions and verification of authorization data.
ticket: 6572
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22875 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/clients/klist')
| -rw-r--r-- | src/clients/klist/klist.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c index c20aa9801e..9e93f7b354 100644 --- a/src/clients/klist/klist.c +++ b/src/clients/klist/klist.c @@ -57,6 +57,7 @@ extern int optind; int show_flags = 0, show_time = 0, status_only = 0, show_keys = 0; int show_etype = 0, show_addresses = 0, no_resolve = 0, print_version = 0; +int show_adtype = 0; char *defname; char *progname; krb5_int32 now; @@ -81,7 +82,7 @@ static void usage() { #define KRB_AVAIL_STRING(x) ((x)?"available":"not available") - fprintf(stderr, "Usage: %s [-e] [-V] [[-c] [-f] [-s] [-a [-n]]] %s", + fprintf(stderr, "Usage: %s [-e] [-V] [[-c] [-d] [-f] [-s] [-a [-n]]] %s", progname, "[-k [-t] [-K]] [name]\n"); fprintf(stderr, "\t-c specifies credentials cache\n"); fprintf(stderr, "\t-k specifies keytab\n"); @@ -89,6 +90,7 @@ static void usage() fprintf(stderr, "\t-e shows the encryption type\n"); fprintf(stderr, "\t-V shows the Kerberos version and exits\n"); fprintf(stderr, "\toptions for credential caches:\n"); + fprintf(stderr, "\t\t-d shows the submitted authorization data types\n"); fprintf(stderr, "\t\t-f shows credentials flags\n"); fprintf(stderr, "\t\t-s sets exit status based on valid tgt existence\n"); fprintf(stderr, "\t\t-a displays the address list\n"); @@ -113,8 +115,11 @@ main(argc, argv) name = NULL; mode = DEFAULT; /* V=version so v can be used for verbose later if desired. */ - while ((c = getopt(argc, argv, "fetKsnack45V")) != -1) { + while ((c = getopt(argc, argv, "dfetKsnack45V")) != -1) { switch (c) { + case 'd': + show_adtype = 1; + break; case 'f': show_flags = 1; break; @@ -570,6 +575,24 @@ show_credential(cred) krb5_free_ticket(kcontext, tkt); } + if (show_adtype) { + int i; + + if (cred->authdata != NULL) { + if (!extra_field) + fputs("\t",stdout); + else + fputs(", ",stdout); + printf("AD types: "); + for (i = 0; cred->authdata[i] != NULL; i++) { + if (i) + printf(", "); + printf("%d", cred->authdata[i]->ad_type); + } + extra_field++; + } + } + /* if any additional info was printed, extra_field is non-zero */ if (extra_field) putchar('\n'); |
