krb5: Do not clobber keytab entry timestamps

We set the timestamp field of krb5_keytab_entry in every case in-tree,
so we should not clobber it in krb5_kt_add_entry().  This is very
important in the context of virtual service principals, as the timestamp
of the keys in the keytab is a clue to when they must be refetched!
This commit is contained in:
Nicolas Williams
2022-10-01 17:49:39 -05:00
parent 1429814eda
commit 323f4631a4

View File

@@ -883,7 +883,8 @@ krb5_kt_add_entry(krb5_context context,
id->prefix);
return KRB5_KT_NOWRITE;
}
entry->timestamp = time(NULL);
if (entry->timestamp == 0)
entry->timestamp = time(NULL);
return (*id->add)(context, id,entry);
}