Store last password change date when parsing MIT dumps in hprop
authorRuss Allbery <rra@stanford.edu>
Tue, 2 Feb 2010 02:11:52 +0000 (18:11 -0800)
committerLove Hornquist Astrand <lha@h5l.org>
Tue, 2 Feb 2010 21:27:10 +0000 (13:27 -0800)
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 <lha@h5l.org>
kdc/mit_dump.c

index 9d1b69619072e116abc9c45c87ce550f936169ed..7d39134dccd70aca3bcfbc4c5d3cfb4c26493959 100644 (file)
@@ -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)