Bug 382091 - rawhide rpm breaks livecd-creator
Summary: rawhide rpm breaks livecd-creator
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 382251 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-14 10:37 UTC by Craig Schlenter
Modified: 2007-11-30 22:12 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-15 10:00:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Craig Schlenter 2007-11-14 10:37:56 UTC
Description of problem:

I'm getting "md5" errors when trying to build a livecd.

Version-Release number of selected component (if applicable):

rpm-4.4.2.2-8.fc9

How reproducible:

Use livecd-creator on a repo that I have which has some rpms
taken out of rawhide at some point in it to make a cd.
  
Actual results:

Retrieving file:///var/www/html/repo/core/repodata/primary.xml.gz ...OK
warning: setup-2.6.4-1.fc7: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
  Installing: setup                        ##################### [  1/112] 
error: unpacking of archive failed on file /etc/aliases;473acafc: cpio: MD5 sum
mismatch
  Installing: filesystem                   ##################### [  2/112] 
  Installing: basesystem                   ##################### [  3/112] 
  Installing: tzdata                       ##################### [  4/112] 
error: unpacking of archive failed on file
/usr/share/doc/tzdata-2007e/README;473acafc: cpio: MD5 sum mismatch
  Installing: libgcc                       ##################### [  5/112] 
error: unpacking of archive failed on file
/lib/libgcc_s-4.1.2-20070503.so.1;473acafc: cpio: MD5 sum mismatch

Expected results:

It should work :)

Additional info:

Downgrading rpm to fc8 (plus rpm-libs and the rpm-python dependency) makes the
problem go away. The rest of my box is pretty much rawhide btw.

Comment 1 Panu Matilainen 2007-11-14 11:17:49 UTC
Likely an initial "side-effect" from the beecrypt -> nss switch...

Comment 2 Tomas Mraz 2007-11-14 13:04:30 UTC
This is caused by too late init of NSS when the calling process is already in
chroot. I call it in the rpmDigestInit in the current patch version. Panu, do
you have some ideas, where we should put it in?


Comment 3 Panu Matilainen 2007-11-14 13:59:34 UTC
Hmm, according to
http://www.mozilla.org/projects/security/pki/nss/ref/ssl/sslfnc.html#1234224 
NSS_NoDB_Init() should only be called once whereas rpmDigestInit() gets called
any number of times from rpmlib.

To ensure it gets called always, early on and just once, the place to put it
(directly or via some rpmInitCrypto() or such call) would be
rpmReadConfigFiles() in lib/rpmrc.c, and even there it's better to protect it
with a static nss_initialized flag to ensure it never gets called twice within a
process lifetime.

BTW the NSS_NoDB_Init() documentation also says PR_Init() must be called first,
but PR_Init() documentation says it's only necessary in some specific cases ..
dunno what to make of that.

Comment 4 Tomas Mraz 2007-11-14 14:20:23 UTC
I think the docs aren't too current because in the source code of
NSS_NoDB_Init() there is clear that it is guarded by a flag so it should be safe
to call it many times. Also the PR_Init is really not necessary in our case.


Comment 5 Panu Matilainen 2007-11-15 08:48:21 UTC
*** Bug 382251 has been marked as a duplicate of this bug. ***

Comment 6 Panu Matilainen 2007-11-15 08:50:12 UTC
Ok, initializing nss from rpmReadConfigFiles() indeed fixes this, patch to
follow shortly...

Comment 7 Panu Matilainen 2007-11-15 10:00:45 UTC
Should be fixed in rpm-4.4.2.2-10.fc9. Thanks for debugging Tomas!


Note You need to log in before you can comment on or make changes to this bug.