[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: convert_hdb dumps core
Leif Johansson <leifj@matematik.su.se> writes:
> However after doing kstash --convert-file and convert_db i cannot
> kinit as me (failed to decrypt PA_DATA in kdc.log).
Yup. More cut-and-paste errors; here is a patch relative to 0.1b.
There will probably be a 0.1c in a few days.
/Johan
--- convert_db.c 1999/02/22 09:53:06 1.3
+++ convert_db.c 1999/02/27 19:48:48 1.5
@@ -40,7 +40,7 @@
#include "hdb_locl.h"
#include "getarg.h"
-RCSID("$Id: convert_db.c,v 1.3 1999/02/22 09:53:06 joda Exp $");
+RCSID("$Id: convert_db.c,v 1.5 1999/02/27 19:48:48 joda Exp $");
static krb5_error_code
func(krb5_context context, HDB *db, hdb_entry *entry, void *data)
@@ -84,7 +84,7 @@
entry->keys.len = save_len;
entry->keys.val = save_val;
for(i = 0; i < n; i++)
- free_Key(&k[n]);
+ free_Key(&k[i]);
free(k);
return 0;
}
@@ -151,13 +151,13 @@
ret = hdb_create(context, &new, new_database);
if(ret != 0)
krb5_err(context, 1, ret, "hdb_create");
- ret = hdb_set_master_key(context, db, key);
+ ret = hdb_set_master_key(context, new, key);
if (ret)
krb5_err(context, 1, ret, "hdb_set_master_key");
ret = db->open(context, db, O_RDONLY, 0);
if(ret)
krb5_err(context, 1, ret, "%s", old_database);
- ret = db->open(context, new, O_CREAT|O_EXCL|O_RDWR, 0600);
+ ret = new->open(context, new, O_CREAT|O_EXCL|O_RDWR, 0600);
if(ret)
krb5_err(context, 1, ret, "%s", new_database);
ret = hdb_foreach(context, db, func, new);