RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/rpmdb/ db3.c dbconfig.c rpmdb.c rpmdb.h

From: Jeff Johnson <n3npq@mac.com>
Date: Mon 18 Aug 2008 - 18:20:36 CEST
Message-id: <1684AE9F-9330-4F21-832C-A8ABD080FC68@mac.com>

On Aug 18, 2008, at 2:16 AM, Alexey Tourbin wrote:

>   @@ -2878,6 +2878,7 @@
>    	if (db->db_tags != NULL)
>    	for (dbix = 0; dbix < db->db_ndbi; dbix++) {
>   +	    dbiIndex dbi;
>    	    DBC * dbcursor = NULL;
>    	    DBT k = DBT_INIT;
>    	    DBT v = DBT_INIT;
>   @@ -2887,7 +2888,6 @@
>    	    rpmTag rpmtag = dbiTag->tag;
>    	    const char * dbiBN = (dbiTag->str != NULL
>    		? dbiTag->str : tagName(rpmtag));
>   -	    dbiIndex dbi;
>    	    rpmuint8_t * bin = NULL;
>    	    int i;
>   @@ -2939,7 +2939,6 @@
>    		if (!xx)
>    		    continue;
>    		/*@switchbreak@*/ break;
>   -
>    	    }
>    	  dbi = dbiOpen(db, he->tag, 0);

Be very careful re-scoping dbiIndex here as well. Or at least watch  
for subtle flaws,
valgrind should catch any flaws iirc.

There's an unexpected recursion when pubkey to verify rpmdb header  
with signature is undertaken. I've forgotten details other than
that a "obvious" refactoring of dbiIndex (or was it a DBT? I  
fergit ...) was related, which is how I screwed
myself way back when in the first place.

There's another point where the recursion has non-obvious  
consequences in rpm code.
I removed that refcount hackery mebbe 6 months ago, not heard problem  
reports, but
that is not at all the same as claiming "fixed".

Note that keyutils cache is now used on linux and the rather slippery  
rpmdb code paths
are likely very different.

Nothing at all wrong with yr patching, and I'd rather see rpmdb break  
again (the symptom
is/was a segfault) and get a properly engineered fix in place. The  
original hack went
in solely because I was given hours at full emergency speed to get a  
"fix" in place for
some ancient RH release.

I'll dig out the details from RH bugzilla and examine more closely  
when I have a chance.

73 de Jeff
Received on Mon Aug 18 18:21:20 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.