From 388341e14941ce8c62a7c8b8cabada4239aa1b20 Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Wed, 24 Nov 2010 15:24:26 -0800 Subject: [PATCH] kgetcred/kvno compat example --- kuser/kcc-commands.in | 56 +++++++++++++++++++++++++++++++++++++++++++ kuser/kcc.c | 22 +++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/kuser/kcc-commands.in b/kuser/kcc-commands.in index 39e9f545e..e8736a3f4 100644 --- a/kuser/kcc-commands.in +++ b/kuser/kcc-commands.in @@ -42,6 +42,62 @@ command = { help = "credential cache to list" } } +command = { + name = "kgetcred" + help = "Acquire a Kerberos ticket" + option = { + long = "enctype" + short = "e" + type = "string" + argument = "enctype" + help = "Encryption type to use" + } + option = { + long = "cache" + short = "c" + type = "string" + argument = "cachename" + help = "Credentials cache" + } +} +command = { + name = "kvno" + help = "Acquire a Kerberos ticket" + option = { + long = "enctype" + short = "e" + type = "string" + argument = "enctype" + help = "Encryption type to use" + } + option = { + long = "cache" + short = "c" + type = "string" + argument = "cachename" + help = "Credentials cache" + } + option = { + long = "keytab" + short = "k" + type = "string" + argument = "keytabname" + help = "Keytab to use" + } + option = { + long = "server" + short = "S" + type = "string" + argument = "principal" + help = "Server to get ticket for" + } + option = { + long = "quiet" + short = "q" + type = "flag" + help = "Quiet" + } +} command = { name = "help" name = "?" diff --git a/kuser/kcc.c b/kuser/kcc.c index 24164af8a..cbf4246b1 100644 --- a/kuser/kcc.c +++ b/kuser/kcc.c @@ -69,6 +69,28 @@ klist(struct klist_options *opt, int argc, char **argv) return 0; } +int +kgetcred(struct kgetcred_options *opt, int argc, char **argv) +{ + return 0; +} + +/* + * Wrapper for command line compatiblity + */ + +int +kvno(struct kvno_options *opt, int argc, char **argv) +{ + struct kgetcred_options k; + memset(&k, 0, sizeof(k)); + + k.cache_string = opt->cache_string; + k.enctype_string = opt->enctype_string; + + return kgetcred(&k, argc, argv); +} + static int command_alias(const char *name) {