Age | Commit message (Collapse) | Author | Files | Lines |
|
In «dpkg --verify» and the dpkg infodb format upgrade logic.
Both are not big leaks, the first is bound by the amount of packages,
as the varbuf is reused for each file on each package, and the second
is just one instance of a leaked varbuf.
Stable-Candidate: 1.16.x 1.17.x
|
|
This adds a proper interface to snapshot a varbuf state and it rollback
so that a common stem can be reused on multiple instances.
|
|
|
|
That is "" or '', and not the unbalanced `' pair.
|
|
|
|
|
|
|
|
|
|
|
|
Make sure to always read the format file whenever we are about to access
the info database, so that we can verify that we understand the format,
and bail out otherwise.
This fixes a currently possible info database corruption and bogus
access, whenever the format is lower than 0 or higher than the last
understood one, and makes the info database code future-proof in case
new actual formats get introduced.
|
|
|
|
The upgrade is scheduled by explicit calls to pkg_infodb_upgrade() if
the current database format version is less than the latest supported
format or if the previous upgrade was interrupted.
The upgrade goes as follows:
- link all old files to their new names.
- set <admindir>/info/format-new to 1.
- remove all old files.
- rename <admindir>/info/format-new to <admindir>/info/format.
In case of abrupt interruption, the presence of <admindir>/info/format-new
means the upgrade is not yet completed and it needs to be retried. In case
of clean interruption with rollback, that file is removed after the old
layout has been restored.
Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org>
Patch-sponsored-by: Linaro Limited
Designed-by: Guillem Jover <guillem@debian.org>
Signed-off-by: Guillem Jover <guillem@debian.org>
|