krb5 commit: Make kproplog handle underfull iprop logs
Greg Hudson
ghudson at MIT.EDU
Fri Jan 25 20:19:54 EST 2013
https://github.com/krb5/krb5/commit/2743fdee849be4a00a9ea72d601004c95b22dd56
commit 2743fdee849be4a00a9ea72d601004c95b22dd56
Author: Greg Hudson <ghudson at mit.edu>
Date: Fri Jan 25 18:59:09 2013 -0500
Make kproplog handle underfull iprop logs
kproplog currently assumes that an iprop log is full once it has
circled--which is true right now but will need to change for
hierarchical slaves. Avoid this assumption by using the correct
index modulus in print_update whether or not the log is full.
Based on a patch from Richard Basch <basch at alum.mit.edu>.
src/slave/kproplog.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/slave/kproplog.c b/src/slave/kproplog.c
index fc4c559..67ff154 100644
--- a/src/slave/kproplog.c
+++ b/src/slave/kproplog.c
@@ -400,7 +400,8 @@ print_attr(kdbe_val_t *val, int vverbose)
* Print the update entry information
*/
static void
-print_update(kdb_hlog_t *ulog, uint32_t entry, unsigned int verbose)
+print_update(kdb_hlog_t *ulog, uint32_t entry, uint32_t ulogentries,
+ unsigned int verbose)
{
XDR xdrs;
uint32_t start_sno, i, j, indx;
@@ -414,7 +415,7 @@ print_update(kdb_hlog_t *ulog, uint32_t entry, unsigned int verbose)
start_sno = ulog->kdb_first_sno - 1;
for (i = start_sno; i < ulog->kdb_last_sno; i++) {
- indx = i % ulog->kdb_num;
+ indx = i % ulogentries;
indx_log = (kdb_ent_header_t *)INDEX(ulog, indx);
@@ -621,7 +622,7 @@ main(int argc, char **argv)
}
if ((!headeronly) && ulog->kdb_num) {
- print_update(ulog, entry, verbose);
+ print_update(ulog, entry, params.iprop_ulogsize, verbose);
}
(void) printf("\n");
More information about the cvs-krb5
mailing list