From e65a16d898f3a686525e83661f4fd86c76e27bbf Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 27 Sep 2012 17:10:41 -0500 Subject: Fix policy refcount corruption race in dump ticket: 7384 --- src/kadmin/dbutil/dump.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c index 100967931..63f48f310 100644 --- a/src/kadmin/dbutil/dump.c +++ b/src/kadmin/dbutil/dump.c @@ -1476,17 +1476,17 @@ dump_db(argc, argv) arglist.kcontext = util_context; fprintf(arglist.ofile, "%s", dump->header); - if (dump_sno) { - /* - * We grab the lock twice (once again in the iterator call), - * but that's ok since the lock func handles incr locks held. - */ - if (krb5_db_lock(util_context, KRB5_LOCKMODE_SHARED)) { - fprintf(stderr, - _("%s: Couldn't grab lock\n"), progname); - goto error; - } + /* + * We grab the lock twice (once again in the iterator call), + * but that's ok since the lock func handles incr locks held. + */ + if (krb5_db_lock(util_context, KRB5_LOCKMODE_SHARED)) { + fprintf(stderr, + _("%s: Couldn't grab lock\n"), progname); + goto error; + } + if (dump_sno) { if (ipropx_version) fprintf(f, " %u", IPROPX_VERSION); fprintf(f, " %u", log_ctx->ulog->kdb_last_sno); -- cgit