]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Disallow unlocked iteration of hash databases 186/head
authorTom Yu <tlyu@mit.edu>
Wed, 6 Aug 2014 22:45:20 +0000 (18:45 -0400)
committerTom Yu <tlyu@mit.edu>
Thu, 7 Aug 2014 20:23:55 +0000 (16:23 -0400)
It's not clear whether unlocked iteration over a hash DB2 database
will omit unaffected entries if database additions or deletions occur
concurrently with the iteration.  Avoid this situation by disabling
unlocked iteration in the unlikely event that someone is still using a
hash database for their KDB.

ticket: 7977

src/plugins/kdb/db2/kdb_db2.c

index b7cdc88e362f883161749dbad03b25be44fdada1..4c2292c0570d4cb2dc235b956387fcce948745a9 100644 (file)
@@ -386,6 +386,9 @@ open_db(krb5_db2_context *dbc, int flags, int mode)
         break;
     }
 
+    /* Don't try unlocked iteration with a hash database. */
+    if (db != NULL && dbc->hashfirst)
+        dbc->unlockiter = FALSE;
 done:
     free(fname);
     return db;