diff options
| author | Marc Horowitz <marc@mit.edu> | 1996-07-22 20:49:46 +0000 |
|---|---|---|
| committer | Marc Horowitz <marc@mit.edu> | 1996-07-22 20:49:46 +0000 |
| commit | edf8b4d8a6a665c2aa150993cd813ea6c5cf12e1 (patch) | |
| tree | 6c2974a97b448c040fa4a31708ec5e02f187526c /src/admin/edit/dump.c | |
| parent | 013bb1391582ed9e653ae706e398ddb8d08cfcc9 (diff) | |
| download | krb5-edf8b4d8a6a665c2aa150993cd813ea6c5cf12e1.tar.gz krb5-edf8b4d8a6a665c2aa150993cd813ea6c5cf12e1.tar.xz krb5-edf8b4d8a6a665c2aa150993cd813ea6c5cf12e1.zip | |
this commit includes all the changes on the OV_9510_INTEGRATION and
OV_MERGE branches. This includes, but is not limited to, the new openvision
admin system, and major changes to gssapi to add functionality, and bring
the implementation in line with rfc1964. before committing, the
code was built and tested for netbsd and solaris.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8774 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/admin/edit/dump.c')
| -rw-r--r-- | src/admin/edit/dump.c | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/src/admin/edit/dump.c b/src/admin/edit/dump.c index 42118d555..bbda74c9d 100644 --- a/src/admin/edit/dump.c +++ b/src/admin/edit/dump.c @@ -328,7 +328,7 @@ dump_k5beta_iterator(ptr, entry) krb5_error_code retval; struct dump_args *arg; char *name, *mod_name; - krb5_tl_mod_princ *mprinc; + krb5_principal mod_princ; krb5_tl_data *pwchg; krb5_key_data *pkey, *akey, nullkey; krb5_timestamp mod_date, last_pwd_change; @@ -358,27 +358,24 @@ dump_k5beta_iterator(ptr, entry) /* * Deserialize the modifier record. */ - mprinc = (krb5_tl_mod_princ *) NULL; mod_name = (char *) NULL; + mod_princ = NULL; last_pwd_change = mod_date = 0; pkey = akey = (krb5_key_data *) NULL; - if (!(retval = krb5_dbe_decode_mod_princ_data(arg->kcontext, + if (!(retval = krb5_dbe_lookup_mod_princ_data(arg->kcontext, entry, - &mprinc))) { - if (mprinc) { - if (mprinc->mod_princ) { - /* - * Flatten the modifier name. - */ - if ((retval = krb5_unparse_name(arg->kcontext, - mprinc->mod_princ, - &mod_name))) - fprintf(stderr, mname_unp_err, arg->programname, - error_message(retval)); - krb5_free_principal(arg->kcontext, mprinc->mod_princ); - } - mod_date = mprinc->mod_date; - krb5_xfree(mprinc); + &mod_date, + &mod_princ))) { + if (mod_princ) { + /* + * Flatten the modifier name. + */ + if ((retval = krb5_unparse_name(arg->kcontext, + mod_princ, + &mod_name))) + fprintf(stderr, mname_unp_err, arg->programname, + error_message(retval)); + krb5_free_principal(arg->kcontext, mod_princ); } } if (!mod_name) @@ -387,11 +384,13 @@ dump_k5beta_iterator(ptr, entry) /* * Find the last password change record and set it straight. */ - for (pwchg = entry->tl_data; - (pwchg) && (pwchg->tl_data_type != KRB5_TL_LAST_PWD_CHANGE); - pwchg = pwchg->tl_data_next); - if (pwchg) { - krb5_kdb_decode_int32(pwchg->tl_data_contents, last_pwd_change); + if (retval = + krb5_dbe_lookup_last_pwd_change(arg->kcontext, entry, + &last_pwd_change)) { + fprintf(stderr, nokeys_err, arg->programname, name); + krb5_xfree(mod_name); + krb5_xfree(name); + return(retval); } /* @@ -823,7 +822,8 @@ find_record_end(f, fn, lineno) putc(ch, stderr); } } - + +#if 0 /* * update_tl_data() - Generate the tl_data entries. */ @@ -908,7 +908,8 @@ update_tl_data(kcontext, dbentp, mod_name, mod_date, last_pwd_change) return(kret); } - +#endif + /* * process_k5beta_record() - Handle a dump record in old format. * @@ -1129,11 +1130,15 @@ process_k5beta_record(fname, kcontext, filep, verbose, linenop) if (!(kret = krb5_parse_name(kcontext, mod_name, &mod_princ))) { - if (!(kret = update_tl_data(kcontext, - &dbent, - mod_princ, - mod_date, - last_pwd_change))) { + if (!(kret = + krb5_dbe_update_mod_princ_data(kcontext, + &dbent, + mod_date, + mod_princ)) && + !(kret = + krb5_dbe_update_last_pwd_change(kcontext, + &dbent, + last_pwd_change))) { int one = 1; dbent.len = KRB5_KDB_V1_BASE_LENGTH; |
