diff options
author | Nicolas Williams <nico@cryptonector.com> | 2012-09-27 17:10:41 -0500 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2012-10-05 15:15:36 -0400 |
commit | e65a16d898f3a686525e83661f4fd86c76e27bbf (patch) | |
tree | 7883a7a69f44e9fcbbba2614b69a347ca7ebf9f3 | |
parent | 3221bdba150ac3910dc7058f02c71008ef56bf52 (diff) | |
download | krb5-e65a16d898f3a686525e83661f4fd86c76e27bbf.tar.gz krb5-e65a16d898f3a686525e83661f4fd86c76e27bbf.tar.xz krb5-e65a16d898f3a686525e83661f4fd86c76e27bbf.zip |
Fix policy refcount corruption race in dump
ticket: 7384
-rw-r--r-- | src/kadmin/dbutil/dump.c | 20 |
1 files 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); |