[26387] in CVS-changelog-for-Kerberos-V5
svn rev #25723: trunk/src/plugins/kdb/db2/
daemon@ATHENA.MIT.EDU (ghudson@mit.edu)
Thu Mar 1 15:49:20 2012
Date: Thu, 1 Mar 2012 15:49:18 -0500
From: ghudson@mit.edu
Message-Id: <201203012049.q21KnIPa008671@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu
http://src.mit.edu/fisheye/changelog/krb5/?cs=25723
Commit By: ghudson
Log Message:
ticket: 7096
subject: Fix KDB iteration when callback does write calls
target_version: 1.10.1
tags: pullup
kdb_db2's ctx_iterate makes an convenience alias to dbc->db in order
to call more invoke call the DB's seq method. This alias may become
invalidated if the callback writes to the DB, since ctx_lock() may
re-open the DB in order to acquire a write lock. Fix the bug by
getting rid of the convenience alias.
Most KDB iteration operations in the code base do not write to the DB,
but kdb5_util update_princ_encryption does.
Bug discovered and diagnosed by will.fiveash@oracle.com.
Changed Files:
U trunk/src/plugins/kdb/db2/kdb_db2.c
Modified: trunk/src/plugins/kdb/db2/kdb_db2.c
===================================================================
--- trunk/src/plugins/kdb/db2/kdb_db2.c 2012-02-29 18:49:04 UTC (rev 25722)
+++ trunk/src/plugins/kdb/db2/kdb_db2.c 2012-03-01 20:49:17 UTC (rev 25723)
@@ -940,7 +940,6 @@
krb5_error_code (*func)(krb5_pointer, krb5_db_entry *),
krb5_pointer func_arg)
{
- DB *db;
DBT key, contents;
krb5_data contdata;
krb5_db_entry *entry;
@@ -951,8 +950,7 @@
if (retval)
return retval;
- db = dbc->db;
- dbret = db->seq(db, &key, &contents, R_FIRST);
+ dbret = dbc->db->seq(dbc->db, &key, &contents, R_FIRST);
while (dbret == 0) {
contdata.data = contents.data;
contdata.length = contents.size;
@@ -974,7 +972,7 @@
retval = retval2;
break;
}
- dbret = db->seq(db, &key, &contents, R_NEXT);
+ dbret = dbc->db->seq(dbc->db, &key, &contents, R_NEXT);
}
switch (dbret) {
case 1:
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5