svn rev #23971: trunk/src/kadmin/dbutil/

ghudson@MIT.EDU ghudson at MIT.EDU
Tue May 4 15:01:16 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=23971
Commit By: ghudson
Log Message:
Get rid of some kdb5_util load code which is no longer useful after
the introduction of the DAL.



Changed Files:
U   trunk/src/kadmin/dbutil/dump.c
Modified: trunk/src/kadmin/dbutil/dump.c
===================================================================
--- trunk/src/kadmin/dbutil/dump.c	2010-05-04 17:08:39 UTC (rev 23970)
+++ trunk/src/kadmin/dbutil/dump.c	2010-05-04 19:01:16 UTC (rev 23971)
@@ -2350,7 +2350,6 @@
     int         argc;
     char        **argv;
 {
-    kadm5_config_params newparams;
     krb5_error_code     kret;
     krb5_context        kcontext;
     FILE                *f;
@@ -2358,7 +2357,6 @@
     extern int          optind;
     char                *dumpfile;
     char                *dbname;
-    char                *dbname_tmp;
     char                buf[BUFSIZ];
     dump_version        *load;
     int                 flags;
@@ -2379,7 +2377,6 @@
     flags = 0;
     crflags = KRB5_KDB_CREATE_BTREE;
     exit_status = 0;
-    dbname_tmp = (char *) NULL;
     log_ctx = util_context->kdblog_context;
 
     for (aindex = 1; aindex < argc; aindex++) {
@@ -2420,18 +2417,11 @@
     }
     dumpfile = argv[aindex];
 
-    if (asprintf(&dbname_tmp, "%s%s", dbname, dump_tmptrail) < 0) {
-        fprintf(stderr, no_name_mem_fmt, progname);
-        exit_status++;
-        return;
-    }
-
     /*
      * Initialize the Kerberos context and error tables.
      */
     if ((kret = kadm5_init_krb5_context(&kcontext))) {
         fprintf(stderr, ctx_err_fmt, progname);
-        free(dbname_tmp);
         exit_status++;
         return;
     }
@@ -2439,7 +2429,6 @@
     if( (kret = krb5_set_default_realm(kcontext, util_context->default_realm)) )
     {
         fprintf(stderr, "%s: Unable to set the default realm\n", progname);
-        free(dbname_tmp);
         exit_status++;
         return;
     }
@@ -2515,19 +2504,7 @@
      * mode, we create an alternate database and then promote it to
      * be the live db.
      */
-    newparams = global_params;
     if (! (flags & FLAG_UPDATE)) {
-        newparams.mask |= KADM5_CONFIG_DBNAME;
-        newparams.dbname = dbname_tmp;
-
-        if ((kret = kadm5_get_config_params(kcontext, 1,
-                                            &newparams, &newparams))) {
-            com_err(progname, kret,
-                    "while retreiving new configuration parameters");
-            exit_status++;
-            return;
-        }
-
         if (!add_db_arg("temporary")) {
             com_err(progname, ENOMEM, "computing parameters for database");
             exit(1);
@@ -2537,12 +2514,7 @@
             com_err(progname, ENOMEM, "computing parameters for database");
             exit(1);
         }
-    }
 
-    /*
-     * If not an update restoration, create the database. otherwise open
-     */
-    if (!(flags & FLAG_UPDATE)) {
         if((kret = krb5_db_create(kcontext, db5util_db_args))) {
             const char *emsg = krb5_get_error_message(kcontext, kret);
             /*
@@ -2558,7 +2530,6 @@
                         progname, dbname, error_message(kret));
             }
             exit_status++;
-            kadm5_free_config_params(kcontext, &newparams);
             if (dumpfile) fclose(f);
             return;
         }
@@ -2686,7 +2657,7 @@
     }
 
     if (!(flags & FLAG_UPDATE) && load->create_kadm5 &&
-        ((kret = kadm5_create_magic_princs(&newparams, kcontext)))) {
+        ((kret = kadm5_create_magic_princs(&global_params, kcontext)))) {
         /* error message printed by create_magic_princs */
         exit_status++;
     }
@@ -2748,7 +2719,5 @@
         fclose(f);
     }
 
-    if (dbname_tmp)
-        free(dbname_tmp);
     krb5_free_context(kcontext);
 }




More information about the cvs-krb5 mailing list