Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] openssl and preserve_old_lib_notify pitfall
Date: Thu, 30 Sep 2010 17:30:53
Message-Id: 4CA4C997.4070106@gentoo.org
In Reply to: [gentoo-dev] openssl and preserve_old_lib_notify pitfall by "Andreas K. Huettel"
1 On 09/30/2010 09:31 AM, Andreas K. Huettel wrote:
2 >
3 > Hi,
4 >
5 > Just by accident I noticed during emerge something that may lead to major confusion: the just stabilized openssl-1.0.0-r3 contains the following code:
6 >
7 > pkg_postinst() {
8 > ...
9 > has_version ${CATEGORY}/${PN}:0.9.8 && return 0
10 > preserve_old_lib_notify /usr/$(get_libdir)/lib{crypto,ssl}.so.0.9.8
11 > }
12 >
13 > However, portage in my case first updated openssl (slot 0) from 0.9.8 to this version, _printing out the preserve_old_lib_notify message_, and then afterwards installed openssl-0.9.8o-r2.
14
15 The preserve_old_lib_notify message in postinst is invalid if the
16 package doesn't actually own the file. It would be safer to check
17 for the file in $D during preinst than to check in $ROOT in postinst
18 like that function does.
19
20 Also, if the openssl-0.9.8o-r2 gets pulled in later then it should
21 bail out due to a file collision, since it's not allows for two
22 different SLOTs to install the same file(s).
23
24 > Net result: if I had relied on the elog messages alone, I would have messed up my system by deleting the required files from openssl:0.9.8...
25 >
26 > I have no clue how this could be improved, though. Any ideas?
27 >
28 > Cheers, Andreas
29 >
30
31
32 --
33 Thanks,
34 Zac

Replies

Subject Author
Re: [gentoo-dev] openssl and preserve_old_lib_notify pitfall Mike Frysinger <vapier@g.o>