Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 15 Jan 2015 13:31:43 +0300
From: Solar Designer <solar@...nwall.com>
To: owl-dev@...ts.openwall.com
Subject: removing /var/lib/rpm/__db.00? on rpm upgrade (was: recent updates)

Galaxy,

On Sat, Jan 10, 2015 at 07:55:33PM +0300, Solar Designer wrote:
> On Mon, Jan 05, 2015 at 10:57:24AM +0300, Solar Designer wrote:
> > # rpm -Uvh gdbm-{,devel-}1*.rpm 
> > Segmentation fault
> 
> Just not to leave this without a follow-up in here, the above was solved
> with a simple:
> 
> rm /var/lib/rpm/__db.00?
> 
> Obviously.

BTW, we (you?) should probably introduce a trigger into rpm.spec, so
that /var/lib/rpm/__db.00? are automatically removed on upgrades from
our older versions of rpm known to have these in incompatible format.

Otherwise our end-users would run into the same problem when upgrading
e.g. from Owl 3.1-stable to Owl-current, even with binaries.

We already have:

%triggerpostun -- %name < 4.2-owl22
# Remove __db.00? files that look like they're pre-NPTL.  We may be removing
# files that are opened and/or memory-mapped by us (by the rpm process that
# installs the new rpm package), but that's OK.  The next invocation of rpm
# will recreate the files.  4.2-owl22 is when we added this trigger, and we
# were already using NPTL at the time, so there is no need to perform the
# size check and possibly remove the files when upgrading from newer versions.
RPMDBDIR=/var/lib/rpm
if [ -f $RPMDBDIR/__db.001 -a "`wc -c < $RPMDBDIR/__db.001`" -le 8192 ]; then
	rm -f $RPMDBDIR/__db.00?
fi

We probably need a similar section for the recent rpm update as well.
Would both sections fire when upgrading from even older rpm, though
(prior to 4.2-owl22)?  Would that be OK?  I guess so, but perhaps the
old section above will become redundant, and thus we need to replace it
rather than add another?  This needs some thinking and testing.

Alexander

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ