From 42de67f5ce47edec230f3a602a509df4dbd1914c Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Fri, 3 Mar 2000 12:35:48 +0000 Subject: [PATCH] (v4_prop): set the `valid_end' from the v4 expiration date instead of the `pw_expire' (ka_convert): set `valid_end' from ka expiration data and `pw_expire' from pw_change + pw_expire (main): add a default database for ka dumping git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7996 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kdc/hprop.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/kdc/hprop.c b/kdc/hprop.c index 91e8994d6..e299ad5c4 100644 --- a/kdc/hprop.c +++ b/kdc/hprop.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -199,8 +199,9 @@ v4_prop(void *arg, Principal *p) ent.max_life = NULL; } - ALLOC(ent.pw_end); - *ent.pw_end = p->exp_date; + ALLOC(ent.valid_end); + *ent.valid_end = p->exp_date; + ret = krb5_make_principal(pd->context, &ent.created_by.principal, realm, "kadmin", @@ -315,11 +316,17 @@ ka_convert(struct prop_data *pd, int fd, struct ka_entry *ent, ALLOC(hdb.max_life); *hdb.max_life = ntohl(ent->max_life); - if(ntohl(ent->pw_end) != NEVERDATE && ntohl(ent->pw_end) != -1){ - ALLOC(hdb.pw_end); - *hdb.pw_end = ntohl(ent->pw_end); + if(ntohl(ent->valid_end) != NEVERDATE && ntohl(ent->valid_end) != -1){ + ALLOC(hdb.valid_end); + *hdb.valid_end = ntohl(ent->valid_end); } + if (ntohl(ent->pw_change) != NEVERDATE && ent->pw_expire != 255) { + ALLOC(hdb.pw_end); + *hdb.pw_end = ntohl(ent->pw_change) + + 24 * 60 * 60 * ent->pw_expire; + } + ret = krb5_make_principal(pd->context, &hdb.created_by.principal, realm, "kadmin", @@ -651,7 +658,8 @@ main(int argc, char **argv) } else #ifdef KASERVER_DB if (ka_db) { - /* no preparation required */ + if (database == NULL) + database = DEFAULT_DATABASE; } else #endif #endif /* KRB4 */