Age | Commit message (Collapse) | Author | Files | Lines |
|
This makes it possible to perform any necessary normal cleanup before
exiting, and unifies the usage with all other command functions.
|
|
It should make the code more clear, and in many cases it avoids having
to use a temporary variable.
|
|
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.
|
|
|
|
This should make the regular expressions easier to read and understand,
and allows to add comments describing specific parts.
Addresses RegularExpressions::RequireExtendedFormatting.
Warned-by: perlcritic
|
|
|
|
The code was not taking into account the root prefix when verifying
pathnames, which resulted in all files failing to verify.
|
|
Make it explicit that we do not care about the return code of these
unlink() calls.
Warned-by: coverity
|
|
Closes: #794688
Reported-by: Sven Joachim <svenjoac@gmx.de>
|
|
Both in «dpkg --help» and dpkg(1). Mark them as supported.
Prompted-by: Johannes Schauer <j.schauer@email.de>
|
|
This avoids confusing the project-wide macro with the DPKG_VERSION_
namespaced ones.
|
|
states
Closes: #377860
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
|
|
Remove pointless dpkg_selabel_get_handle() function, rename
dpkg_sehandle to sehandle, and change dpkg_selabel_set_context() to
access the variable directly.
|
|
If the mode does not have a file type, for whatever reason, the
libselinux labelling code will try to match on the pathname, which
is better than no labelling at all.
This should never happen in practice, but it is a safer assumption
and more future proof.
|
|
We need to pass the file type in the mode so that the SE labelling
function does anything at all.
Closes: #786435
|
|
None of the deb toolchain supports embedded newlines in filenames, we
could try to escape them but then we'd need to add support in other
tools to unescape these too, and this does not sem worth the trouble.
Closes: #720761
|
|
We need to make sure that the cached arch-qualified package name is
updated too, or we might end up with the wrong arch-qualified package
name on cross-upgrades.
|
|
When parsing command-line arguments we should not say that the error
comes from the statoverride file.
|
|
We need to restore the admindir permissions or the subsequent
non-skipped test will not pass.
|
|
Signed-off-by: Niels Thykier <niels@thykier.net>
|
|
|
|
The /dev/full device is not usually available outside of Linux, and we
should not rely on it.
|
|
On FreeBSD «rm -rf» cannot traverse a directory with mode 000, so we
need to remove it beforehand.
|
|
|
|
That is "" or '', and not the unbalanced `' pair.
|
|
|
|
Cherry picked from commit 5c58085b746d234066ea94d386182cfc72c612ba.
We should not allow adding user or group names to the database that do
not exist in the system passwd database, as the main dpkg program uses
strict parsing and will fail with an unrecoverable fatal error if it
cannot find a matching name for a uid/gid.
Regression introduced in commit e4d6db177fad401ddc8432cf0e2c64e4fcf7bc0d,
where we went from too strict to too lax parsing.
Closes: #775124
|
|
Change the signature to take a pkginfo instead of a list of conffiles.
And turn the while loop into a for loop.
|
|
|
|
|
|
|
|
|
|
|
|
We should not short-circuit on first match for a package, as that
produces bogus errors when the following arguments do match those
packages as well, either because they are repeated or because they
are sub or super-patterns.
Closes: #588505
|
|
|
|
When we update the file, we should apply the SE Linux context in the
same way we are doing while unpacking binary packages.
Closes: #690361
|
|
This will allow to use the code in dpkg-statoverride, and unclutters
the tar handling code.
|
|
The parser always converts the value from DPKG_ARCH_NONE to
DPKG_ARCH_EMPTY, so we will handle both here to avoid any such
problem in the future.
Regression introduced in commit 0238c795df88925c6579f740c7681ade22e88625.
|
|
|
|
These have very confusing semantics, and for the same reason that they
should be avoided in package control data, they should be avoided on
the command-line. Emit a warning for unsuspecting users that might get
trapped by these operators.
|
|
|
|
|
|
|
|
|
|
|
|
We are using these on arrays, so we end up having to compute the total
size from the number of members and the member size. Just delegate the
computation to the underlaying call which should ideally also handle
overflows and similar. And we can always pass nmemb=1 from the call
sites if needed.
|
|
We should not be trimming those characters from substring matches, or we
might get very confusing results.
This was actually the intention behind commit
af9e264518c4cab8e70788d0724d362ef25534d6, but somehow failed at it.
|
|
Limit the buffer accesses to the size of the buffer being accessed. This
affects reads done when parsing field and trigger names, or checking the
package ownership of conffiles and directories.
Use a new length member for struct fieldinfo and nickname to avoid
recomputing the same known length over and over again, but use strlen()
instead for arbitrary fields, conffiles and directories to avoid
increaseing the memory footprint too much.
Reported-by: Joshua Rogers <megamansec@gmail.com>
|