kuser: kgetcred support for anonymous service tickets

This commit is contained in:
Luke Howard
2019-05-03 16:05:09 +10:00
committed by Jeffrey Altman
parent 55ee6c1282
commit 4559618391
2 changed files with 8 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ static char *impersonate_str;
static char *nametype_str;
static int store_flag = 1;
static int cached_only_flag;
static int anonymous_flag;
static int debug_flag;
static int version_flag;
static int help_flag;
@@ -76,6 +77,8 @@ struct getargs args[] = {
NP_("don't store the tickets obtained in the cache", ""), NULL },
{ "cached-only", 0, arg_flag, &cached_only_flag,
NP_("don't talk to the KDC, just search the cache", ""), NULL },
{ "anonymous", 'n', arg_flag, &anonymous_flag,
NP_("request an anonymous ticket", ""), NULL },
{ "debug", 0, arg_flag, &debug_flag, NULL, NULL },
{ "version", 0, arg_flag, &version_flag, NULL, NULL },
{ "help", 0, arg_flag, &help_flag, NULL, NULL }
@@ -176,6 +179,8 @@ main(int argc, char **argv)
krb5_get_creds_opt_add_options(context, opt, KRB5_GC_NO_STORE);
if (cached_only_flag)
krb5_get_creds_opt_add_options(context, opt, KRB5_GC_CACHED);
if (anonymous_flag)
krb5_get_creds_opt_add_options(context, opt, KRB5_GC_ANONYMOUS);
if (delegation_cred_str) {
krb5_ccache id;