summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-01-08 13:17:22 +0200
committerPanu Matilainen <pmatilai@redhat.com>2009-01-08 13:17:22 +0200
commit5ff05aec30ddceb0fc8f2ecd7797aa7bdc9bc96d (patch)
tree0d5371d1fd42a07d0723c7eb0535f15c09cc5fd5 /rpmio
parentc895fb1541f5edbdc53eb6d70eb6157566e6e528 (diff)
downloadrpm-5ff05aec30ddceb0fc8f2ecd7797aa7bdc9bc96d.tar.gz
rpm-5ff05aec30ddceb0fc8f2ecd7797aa7bdc9bc96d.tar.bz2
rpm-5ff05aec30ddceb0fc8f2ecd7797aa7bdc9bc96d.zip
Delay NSS initialization until actually used
- since NSS is allergic (ie becomes non-functional) after forking, delay it's initialization until really needed, ie lazy init in rpmDigestInit() - however as NSS init can fail if attempted in completely empty chroot, we force crypto init to happen at transaction set create time, forking past that is pretty much doomed anyway - this is the other half of the fix for rhbz#476737, and similar case noticed by Pixel in Mandriva (due to urpm forking)
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/digest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rpmio/digest.c b/rpmio/digest.c
index 64b678b86..c565cf608 100644
--- a/rpmio/digest.c
+++ b/rpmio/digest.c
@@ -75,8 +75,12 @@ DIGEST_CTX
rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags)
{
HASH_HashType type;
- DIGEST_CTX ctx = xcalloc(1, sizeof(*ctx));
+ DIGEST_CTX ctx;
+ if (rpmInitCrypto() < 0)
+ return NULL;
+
+ ctx = xcalloc(1, sizeof(*ctx));
ctx->flags = flags;
type = getHashType(hashalgo);