krb5 commit [krb5-1.13]: Use blocking lock when creating db2 KDB

Tom Yu tlyu at mit.edu
Wed Feb 24 15:51:29 EST 2016


https://github.com/krb5/krb5/commit/a288a808a0a550fa20ee8361a60f6de9578bdbf4
commit a288a808a0a550fa20ee8361a60f6de9578bdbf4
Author: Greg Hudson <ghudson at mit.edu>
Date:   Tue Feb 23 17:15:18 2016 -0500

    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.
    
    (cherry picked from commit 1868916dbb60a64b92da217257b4ed021262afd3)
    
    ticket: 8367
    version_fixed: 1.13.4
    tags: -pullup
    status: resolved

 src/plugins/kdb/db2/kdb_db2.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/plugins/kdb/db2/kdb_db2.c b/src/plugins/kdb/db2/kdb_db2.c
index 7bc760a..1b7bc16 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);


More information about the cvs-krb5 mailing list