[28668] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit [krb5-1.13]: Parse "ktadd -norandkey" in remote kadmin

daemon@ATHENA.MIT.EDU (Tom Yu)
Tue Dec 16 14:25:55 2014

Date: Tue, 16 Dec 2014 14:25:45 -0500
From: Tom Yu <tlyu@mit.edu>
Message-Id: <201412161925.sBGJPjEM020010@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/f5a40c03c5a93713468f740600cb443f53792e84
commit f5a40c03c5a93713468f740600cb443f53792e84
Author: Tom Yu <tlyu@mit.edu>
Date:   Thu Oct 16 15:40:33 2014 -0400

    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: 7962
    version_fixed: 1.13.1
    status: resolved

 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 e260fbe..96dc51b 100644
--- a/src/kadmin/cli/keytab.c
+++ b/src/kadmin/cli/keytab.c
@@ -47,9 +47,7 @@ static char *etype_string(krb5_enctype enctype);
 
 static int quiet;
 
-#ifdef KADMIN_LOCAL
 static int norandkey;
-#endif
 
 static void
 add_usage()
@@ -130,9 +128,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++;
@@ -143,9 +139,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--;
@@ -171,13 +171,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;
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post