]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
* dump.c: Changed to include server_internal.h instead of adb.h.
authorMitchell Berger <mitchb@mit.edu>
Wed, 20 Jun 2001 07:24:11 +0000 (07:24 +0000)
committerMitchell Berger <mitchb@mit.edu>
Wed, 20 Jun 2001 07:24:11 +0000 (07:24 +0000)
(load_db): kadm5_server_handle_rec added for the new
osa_adb_open_policy calling sequence.

* kdb5_create.c: Comment about steps in creating a database updated to
include a step where the generation number is initialized.  Call to
initialize the generation number upon creation of the master principal
added.

* kdb5_util.c: Changed to include server_internal.h instead of adb.h.
(open_db_and_mkey): kadm5_server_handle_rec added for the new
osa_adb_open_policy calling sequence.

* loadv4.c: Unimportant whitespace change in a comment.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/incremental-propagation-branch@13404 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/dbutil/ChangeLog
src/kadmin/dbutil/dump.c
src/kadmin/dbutil/kdb5_create.c
src/kadmin/dbutil/kdb5_util.c
src/kadmin/dbutil/loadv4.c

index b0f8a5869236f187e7e1695071595554c4673696..8390bbb9d906af6b8ab6b7e4272ddb3f138e59e2 100644 (file)
@@ -1,3 +1,20 @@
+2001-06-20  Mitchell Berger  <mitchb@mit.edu>
+
+       * dump.c: Changed to include server_internal.h instead of adb.h.
+       (load_db): kadm5_server_handle_rec added for the new
+       osa_adb_open_policy calling sequence.
+
+       * kdb5_create.c: Comment about steps in creating a database updated to
+       include a step where the generation number is initialized.  Call to
+       initialize the generation number upon creation of the master principal
+       added.
+
+       * kdb5_util.c: Changed to include server_internal.h instead of adb.h.
+       (open_db_and_mkey): kadm5_server_handle_rec added for the new
+       osa_adb_open_policy calling sequence.
+
+       * loadv4.c: Unimportant whitespace change in a comment.
+
 2001-06-20  Mitchell Berger  <mitchb@mit.edu>
 
        * kdb5_create.c (kdb5_create): Fixed typo in com_err message.
index fbc88372212f44c6ce7f891cf8d55f400fedebde..04cfa571515ca60fa1dd4cf042005c8fba5dc749 100644 (file)
@@ -30,7 +30,7 @@
 #include <stdio.h>
 #include <k5-int.h>
 #include <kadm5/admin.h>
-#include <kadm5/adb.h>
+#include <kadm5/server_internal.h>
 #include <com_err.h>
 #include "kdb5_util.h"
 #if defined(HAVE_REGEX_H) && defined(HAVE_REGCOMP)
@@ -2079,6 +2079,7 @@ load_db(argc, argv)
     int                        update, verbose;
     krb5_int32         crflags;
     int                        aindex;
+    kadm5_server_handle_rec kadm5_handle;
 
     /*
      * Parse the arguments.
@@ -2250,7 +2251,15 @@ load_db(argc, argv)
         exit_status++;
         goto error;
     }
-    if ((kret = osa_adb_open_policy(&tmppol_db, &newparams))) {
+
+    /* XXX Horrible kludge - to get generation number increases from policy
+     * from policy updates, the policy db handle needs a handle to the
+     * principal db so it can do a kdb_get_entry on the master principal.
+     * The context and params are the only things looked at.
+     */
+    kadm5_handle.context = kcontext;
+    kadm5_handle.params = global_params;
+    if ((kret = osa_adb_open_policy(&tmppol_db, &newparams, &kadm5_handle))) {
         fprintf(stderr, "%s: %s while opening policy database\n",
                 programname, error_message(kret));
         exit_status++;
index 10972ccc8b748fc4e657665307dccb64501fc306..eb711c1d5a3b1835061072bd0ad4aa7c95745ed5 100644 (file)
@@ -104,11 +104,13 @@ static krb5_error_code add_principal
  *
  * 2) get a realm name for the new db
  *
- * 3) get a master password for the new db; convert to an encryption key.
+ * 3) get a master password for the new db; convert to an encryption key
  *
  * 4) create various required entries in the database
  *
- * 5) close & exit
+ * 5) initialize the database generation number
+ *
+ * 6) close & exit
  */
 
 extern krb5_keyblock master_keyblock;
@@ -408,6 +410,9 @@ add_principal(context, princ, op, pblock)
                                                  &master_keyblock, NULL, 
                                                  1, entry.key_data)))
            return retval;
+        if ((retval = krb5_dbe_update_generation_number_general(util_context,
+                                                                &entry, 1)))
+            return retval;
        break;
     case TGT_KEY:
        iargs.ctx = context;
index 849c24a9d66354a7d3a1d13dcd73375f3960ef9c..9e65266b87d8f9b42693b53352ebd4b8d9f46bab 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * admin/edit/kdb5_edit.c
+ * kadmin/dbutil/kdb5_util.c
  *
- * (C) Copyright 1990,1991, 1996 by the Massachusetts Institute of Technology.
- * All Rights Reserved.
+ * (C) Copyright 1990,1991,1996,2001 by the Massachusetts Institute of
+ * Technology.  All Rights Reserved.
  *
  * Export of this software from the United States of America may
  *   require a specific license from the United States Government.
@@ -57,7 +57,7 @@
 #include <k5-int.h>
 #include <kadm5/admin.h>
 #include <krb5/adm_proto.h>
-#include <kadm5/adb.h>
+#include <kadm5/server_internal.h>
 #include <time.h>
 #include "kdb5_util.h"
 
@@ -301,6 +301,7 @@ static int open_db_and_mkey()
     int nentries;
     krb5_boolean more;
     krb5_data scratch, pwd, seed;
+    kadm5_server_handle_rec kadm5_handle;
 
     dbactive = FALSE;
     valid_master_key = 0;
@@ -316,7 +317,15 @@ static int open_db_and_mkey()
        exit_status++;
        return(1);
     }
-    if ((retval = osa_adb_open_policy(&policy_db, &global_params))) {
+    /* XXX Horrible kludge.  To get the generation number to increase from
+     * policy updates, the handle to the policy db needs a handle to the
+     * principal db so it can do a kdb_get_entry on the master principal.
+     * The only things it looks at are the context and params.
+     */
+    kadm5_handle.context = util_context;
+    kadm5_handle.params = global_params;
+    if ((retval = osa_adb_open_policy(&policy_db, &global_params,
+                                     &kadm5_handle))) {
        com_err(progname, retval, "opening policy database");
        exit_status++;
        return (1);
index a93f7aadff7956d0e555bb18d0d17686a8902489..e94f1471a4c58f6fe7081937e787b00c33321a06 100644 (file)
@@ -75,7 +75,7 @@ static char *v4_mkeyfile = "/.k";
 /* Define to make certain blocks private */
 #define V4_DECLARES_STATIC
 #include "kdb5_util.h"
-#include "kadm5/adb.h"                  /* osa_adb_create_policy_db */
+#include "kadm5/adb.h"                 /* osa_adb_create_policy_db */
 #include <netinet/in.h>                        /* ntohl */
 
 #define PROGNAME argv[0]