From 73d0fc23a419f5037967a6c6f4797b371a7303b7 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Mon, 1 Feb 2010 18:11:52 -0800 Subject: [PATCH] Store last password change date when parsing MIT dumps in hprop If the MIT dump file includes a last password change date, allocate a database extension structure to hold that information and include it in the corresponding Heimdal database entry. Signed-off-by: Love Hornquist Astrand --- kdc/mit_dump.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kdc/mit_dump.c b/kdc/mit_dump.c index 9d1b69619..7d39134dc 100644 --- a/kdc/mit_dump.c +++ b/kdc/mit_dump.c @@ -311,6 +311,20 @@ mit_prop_dump(void *arg, const char *file) #define mit_KRB5_TL_LAST_PWD_CHANGE 1 #define mit_KRB5_TL_MOD_PRINC 2 switch(tl_type) { + case mit_KRB5_TL_LAST_PWD_CHANGE: + buf = malloc(tl_length); + if (buf == NULL) + errx(ENOMEM, "malloc"); + getdata(&p, buf, tl_length); /* data itself */ + val = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); + free(buf); + ALLOC(ent.entry.extensions); + ALLOC_SEQ(ent.entry.extensions, 1); + ent.entry.extensions->val[0].mandatory = 0; + ent.entry.extensions->val[0].data.element + = choice_HDB_extension_data_last_pw_change; + ent.entry.extensions->val[0].data.u.last_pw_change = val; + break; case mit_KRB5_TL_MOD_PRINC: buf = malloc(tl_length); if (buf == NULL)