From: Greg Hudson Date: Tue, 23 Feb 2016 22:15:18 +0000 (-0500) Subject: Use blocking lock when creating db2 KDB X-Git-Tag: krb5-1.15-beta1~256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1868916dbb60a64b92da217257b4ed021262afd3;p=thirdparty%2Fkrb5.git Use blocking lock when creating db2 KDB In 1.11 we switched from non-blocking to blocking locks in the DB2 module, but we missed one call to krb5_lock_file() in ctx_create_db(). This non-blocking lock can cause krb5_db_promote() to fail if the database is locked when we try to promote the DB, in turn causing kdb5_util load to fail. Correct this call to make krb5_db_promote() more robust. ticket: 8367 (new) target_version: 1.14-next target_version: 1.13-next tags: pullup --- diff --git a/src/plugins/kdb/db2/kdb_db2.c b/src/plugins/kdb/db2/kdb_db2.c index 7bc760ae2d..1b7bc16f5d 100644 --- a/src/plugins/kdb/db2/kdb_db2.c +++ b/src/plugins/kdb/db2/kdb_db2.c @@ -701,8 +701,7 @@ ctx_create_db(krb5_context context, krb5_db2_context *dbc) retval = errno; goto cleanup; } - retval = krb5_lock_file(context, dbc->db_lf_file, - KRB5_LOCKMODE_EXCLUSIVE | KRB5_LOCKMODE_DONTBLOCK); + retval = krb5_lock_file(context, dbc->db_lf_file, KRB5_LOCKMODE_EXCLUSIVE); if (retval != 0) goto cleanup; set_cloexec_fd(dbc->db_lf_file);