diff options
author | Tom Yu <tlyu@mit.edu> | 2014-10-16 15:40:33 -0400 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2015-02-14 16:10:00 -0500 |
commit | b32f7131bb46154f16e127a8b61b06206c6acca3 (patch) | |
tree | 429752864b89ffa00a9972270af5d446abc5c9b9 | |
parent | f9628f84c76869a2e89ed98a24f1d0cab58a485e (diff) | |
download | krb5-b32f7131bb46154f16e127a8b61b06206c6acca3.zip krb5-b32f7131bb46154f16e127a8b61b06206c6acca3.tar.gz krb5-b32f7131bb46154f16e127a8b61b06206c6acca3.tar.bz2 |
Parse "ktadd -norandkey" in remote kadmin client
The remote kadmin client would not parse the "-norandkey" option to
the ktadd subcommand, terminating option parsing and possibly causing
options to be interpreted as principal names.
(cherry picked from commit 13e9694b17945d43d0cfc203b2645204f2d87086)
ticket: 8148 (new)
version_fixed: 1.11.6
status: resolved
-rw-r--r-- | src/kadmin/cli/keytab.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/kadmin/cli/keytab.c b/src/kadmin/cli/keytab.c index 6d7288f..5807879 100644 --- a/src/kadmin/cli/keytab.c +++ b/src/kadmin/cli/keytab.c @@ -52,9 +52,7 @@ static char *etype_string(krb5_enctype enctype); static int quiet; -#ifdef KADMIN_LOCAL static int norandkey; -#endif static void add_usage() @@ -135,9 +133,7 @@ kadmin_keytab_add(int argc, char **argv) argc--; argv++; quiet = 0; -#ifdef KADMIN_LOCAL norandkey = 0; -#endif while (argc) { if (strncmp(*argv, "-k", 2) == 0) { argc--; argv++; @@ -148,9 +144,13 @@ kadmin_keytab_add(int argc, char **argv) keytab_str = *argv; } else if (strcmp(*argv, "-q") == 0) { quiet++; -#ifdef KADMIN_LOCAL } else if (strcmp(*argv, "-norandkey") == 0) { +#ifdef KADMIN_LOCAL norandkey++; +#else + fprintf(stderr, + _("-norandkey option only valid for kadmin.local\n")); + return; #endif } else if (strcmp(*argv, "-e") == 0) { argc--; @@ -176,13 +176,11 @@ kadmin_keytab_add(int argc, char **argv) return; } -#ifdef KADMIN_LOCAL if (norandkey && ks_tuple) { fprintf(stderr, _("cannot specify keysaltlist when not changing key\n")); return; } -#endif if (process_keytab(context, &keytab_str, &keytab)) return; |