Changes to support new principal type
authorTheodore Tso <tytso@mit.edu>
Tue, 18 Aug 1992 23:12:32 +0000 (23:12 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 18 Aug 1992 23:12:32 +0000 (23:12 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2322 dc483132-0cff-0310-8789-dd5450dbe970

src/admin/create/kdb5_create.c

index 87c47cdc0fcc543e39af6809c757787cafe712ba..168a0030e1983fe710308bbaa150eee2cb69caf6 100644 (file)
@@ -97,8 +97,8 @@ krb5_principal master_princ;
 krb5_encrypt_block master_encblock;
 
 krb5_data tgt_princ_entries[] = {
-       {0, 0},
-       {sizeof(TGTNAME)-1, TGTNAME} };
+       {sizeof(TGTNAME)-1, TGTNAME},
+       {0, 0} };
 
 krb5_data db_creator_entries[] = {
        {sizeof("db_creation")-1, "db_creation"} };
@@ -115,7 +115,7 @@ krb5_principal_data tgt_princ = {
 krb5_principal_data db_create_princ = {
        {0, 0},                                 /* krb5_data realm */
        db_creator_entries,                     /* krb5_data *data */
-       2,                                      /* int length */
+       1,                                      /* int length */
        KRB5_NT_SRV_INST                        /* int type */
 };
 
@@ -215,10 +215,12 @@ char *argv[];
        exit(1);
     }
 
-    krb5_princ_set_realm_data(&tgt_princ, realm);
-    krb5_princ_set_realm_length(&tgt_princ, strlen(realm));
     krb5_princ_set_realm_data(&db_create_princ, realm);
     krb5_princ_set_realm_length(&db_create_princ, strlen(realm));
+    krb5_princ_set_realm_data(&tgt_princ, realm);
+    krb5_princ_set_realm_length(&tgt_princ, strlen(realm));
+    krb5_princ_component(&tgt_princ,1)->data = realm;
+    krb5_princ_component(&tgt_princ,1)->length = strlen(realm);
 
     printf("Initializing database '%s' for realm '%s',\n\
 master key name '%s'\n",
@@ -230,7 +232,7 @@ master key name '%s'\n",
 
     /* TRUE here means read the keyboard, and do it twice */
     if (retval = krb5_db_fetch_mkey(master_princ, &master_encblock, TRUE, TRUE,
-                                   &master_keyblock)) {
+                                   0, &master_keyblock)) {
        com_err(argv[0], retval, "while reading master key");
        exit(1);
     }