summaryrefslogtreecommitdiffstats
path: root/src/include/kdb_log.h
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2014-01-20 18:46:52 -0500
committerGreg Hudson <ghudson@mit.edu>2014-02-20 15:55:48 -0500
commitd1f9aa3737b2b3e62b5c5ed488d6112b7ce8a5ad (patch)
treef5f86bc7a30d0c05db26e9dacc20e875cf9bac9e /src/include/kdb_log.h
parent444ef5fe9ec8d64a5db27b3a8aaf6813dd7ef0e0 (diff)
downloadkrb5-d1f9aa3737b2b3e62b5c5ed488d6112b7ce8a5ad.tar.gz
krb5-d1f9aa3737b2b3e62b5c5ed488d6112b7ce8a5ad.tar.xz
krb5-d1f9aa3737b2b3e62b5c5ed488d6112b7ce8a5ad.zip
Factor out ulog serial number status check
Add a new function ulog_get_sno_status, which checks a serial number and timestamp against the ulog for currency. Use it in kdb5_util dump and in ulog_get_entries. Adjust parse_iprop_header's contract in dump.c to better match the ulog_get_sno_status contract. This change causes some minor behavior differences. kadmind will check for an empty ulog unless the last serial number matches exactly, and will never set lastentry when returning UPDATE_FULL_RESYNC_NEEDED (which was pointless). kdb5_util dump will recognize a dump file as current if it exactly matches the last serial number, even if the ulog is empty; it will be more robust in the presence of non-monotonic clocks; and it will properly lock around the ulog access.
Diffstat (limited to 'src/include/kdb_log.h')
-rw-r--r--src/include/kdb_log.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/kdb_log.h b/src/include/kdb_log.h
index c61b285a4c..35b9d55655 100644
--- a/src/include/kdb_log.h
+++ b/src/include/kdb_log.h
@@ -82,6 +82,8 @@ krb5_error_code ulog_conv_2dbentry(krb5_context context, krb5_db_entry **entry,
void ulog_free_entries(kdb_incr_update_t *updates, int no_of_updates);
krb5_error_code ulog_set_role(krb5_context ctx, iprop_role role);
krb5_error_code ulog_lock(krb5_context ctx, int mode);
+update_status_t ulog_get_sno_status(krb5_context context,
+ const kdb_last_t *last);
typedef struct kdb_hlog {
uint32_t kdb_hmagic; /* Log header magic # */