krb5 commit: Display more extended errors in kdb5_util

Greg Hudson ghudson at mit.edu
Tue Apr 17 13:01:44 EDT 2018


https://github.com/krb5/krb5/commit/15ce7cb89669d761f41561ffcbd6e3f6d80f4224
commit 15ce7cb89669d761f41561ffcbd6e3f6d80f4224
Author: Greg Hudson <ghudson at mit.edu>
Date:   Sat Apr 14 19:17:30 2018 -0400

    Display more extended errors in kdb5_util
    
    In kadm5_create(), use the global context instead of a newly created
    context, so that extended error messages are displayed properly by
    extended_com_err_fn().
    
    ticket: 8665 (new)

 src/kadmin/dbutil/kadm5_create.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/kadmin/dbutil/kadm5_create.c b/src/kadmin/dbutil/kadm5_create.c
index 1745a4d..4f254a3 100644
--- a/src/kadmin/dbutil/kadm5_create.c
+++ b/src/kadmin/dbutil/kadm5_create.c
@@ -68,28 +68,22 @@ static int add_admin_princs(void *handle, krb5_context context, char *realm);
 int kadm5_create(kadm5_config_params *params)
 {
     int retval;
-    krb5_context context;
-
     kadm5_config_params lparams;
 
-    if ((retval = kadm5_init_krb5_context(&context)))
-        exit(ERR);
-
     /*
      * The lock file has to exist before calling kadm5_init, but
      * params->admin_lockfile may not be set yet...
      */
-    if ((retval = kadm5_get_config_params(context, 1,
-                                          params, &lparams))) {
+    retval = kadm5_get_config_params(util_context, 1, params, &lparams);
+    if (retval) {
         com_err(progname, retval, _("while looking up the Kerberos "
                                     "configuration"));
         return 1;
     }
 
-    retval = kadm5_create_magic_princs(&lparams, context);
+    retval = kadm5_create_magic_princs(&lparams, util_context);
 
-    kadm5_free_config_params(context, &lparams);
-    krb5_free_context(context);
+    kadm5_free_config_params(util_context, &lparams);
 
     return retval;
 }


More information about the cvs-krb5 mailing list