(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
This commit is contained in:
20
kdc/hprop.c
20
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).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -199,8 +199,9 @@ v4_prop(void *arg, Principal *p)
|
|||||||
ent.max_life = NULL;
|
ent.max_life = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ALLOC(ent.pw_end);
|
ALLOC(ent.valid_end);
|
||||||
*ent.pw_end = p->exp_date;
|
*ent.valid_end = p->exp_date;
|
||||||
|
|
||||||
ret = krb5_make_principal(pd->context, &ent.created_by.principal,
|
ret = krb5_make_principal(pd->context, &ent.created_by.principal,
|
||||||
realm,
|
realm,
|
||||||
"kadmin",
|
"kadmin",
|
||||||
@@ -315,9 +316,15 @@ ka_convert(struct prop_data *pd, int fd, struct ka_entry *ent,
|
|||||||
ALLOC(hdb.max_life);
|
ALLOC(hdb.max_life);
|
||||||
*hdb.max_life = ntohl(ent->max_life);
|
*hdb.max_life = ntohl(ent->max_life);
|
||||||
|
|
||||||
if(ntohl(ent->pw_end) != NEVERDATE && ntohl(ent->pw_end) != -1){
|
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);
|
ALLOC(hdb.pw_end);
|
||||||
*hdb.pw_end = ntohl(ent->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,
|
ret = krb5_make_principal(pd->context, &hdb.created_by.principal,
|
||||||
@@ -651,7 +658,8 @@ main(int argc, char **argv)
|
|||||||
} else
|
} else
|
||||||
#ifdef KASERVER_DB
|
#ifdef KASERVER_DB
|
||||||
if (ka_db) {
|
if (ka_db) {
|
||||||
/* no preparation required */
|
if (database == NULL)
|
||||||
|
database = DEFAULT_DATABASE;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#endif /* KRB4 */
|
#endif /* KRB4 */
|
||||||
|
Reference in New Issue
Block a user