Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
The problem with assert() is that it does not print the contents of
the variables. It also can be disabled on NDEBUG. But we always want
these consistency checks no matter what, and they are not performance
sensitive anyway.
Enable -Wno-nonnull-compare so that we can keep doing run-time non-NULL
checks in functions, instead of just compile-time checks.
|
|
Modifying the struct pkginfo and struct pkgbin complicates how the code
is used, and when the function can be called. Let's just initialize the
pkgname_archqual variable at parse time, so that we can use it at any
time, simplifying the overall code.
|
|
|
|
In commit 1f4d0354fc4a8c80c6463b9aaebd93822247341b we opted to map the
BSD int types to the C99 to avoid modifying the imported code. But we
had to modify it anyway, those types are legacy and we require the C99
ones for the rest of the codebase. So let's just switch to them, and
get rid of the type compatibility mapping.
|
|
We have slightly modified the source and might continue to do so in the
future, we should thus test that it builds correctly, even if we are not
needing it on the current build.
|
|
The glibc implementation provides this macro in <sys/sysmacros.h> and
optionally the BSD variants in <sys/types.h>, although the latter are
being deprecated and emit a warning with newer glibc. Conditionally
include <sys/sysmacros.h> to prepare for the future removal from glibc.
|
|
|
|
For command-names the current message was more or less fine. But for
command descriptions the message made little sense.
|
|
This is a well-known executable maintainer script, that ideally should
be handled by dpkg itself. But for now we will at least sanity check its
file type and permissions.
|
|
Fixes: commit 59f63342b9121b9d941d3dbd09487c953a113f6e
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The previous code was both not checking for overflows, and triggering
undefined behavior as it was overflowing a signed integer.
Closes: #868356
|
|
Extend it instead, to make sure that we preserve the libcompat
dependency generated from LIBADD.
|
|
Make the existing octal parser more robust, by checking for the expected
format of leading zeros or spaces, followed by any ASCII octal characters
(0-7), followed by zero or more space or NULs. Even though POSIX specifies
that numerical fields should end with at least one space or NUL, we still
support this extension which has been present in other implementations
for a long time.
Add support for base-256 encoded numeric fields, to support large
values, for UID/GID, device number, size and even negative timestamps.
This is necessary not only to be able to store larger values, but to
cover packages that can already be generated by dpkg-deb, given that it
uses the system GNU tar when building.
Closes: #850834
|
|
We should not try to parse these fields if the tar entry is neither
a block nor a char device.
On older tar entries these fields will be all NULs, so it would make
a parser expecting a somewhat strictly formatted octal value to error
out.
|
|
The test suite only handles empty files, so it never had any problem
with not skipping those objects. But when testing it on common data,
and to make the code future-proof, we should just skip the file
objects when parsing them.
|
|
This causes build failures when enabling the shared library.
|
|
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The field width in a format string does not limit the number of bytes
emitted, so we can overflow, even if we are checking the number of bytes
written. Use snprintf() to limit the amount written.
Warned-by: gcc-7
|
|
This can cause issues if the declaration is not exactly the same, and
declaring it when the system already does is bogus no matter what.
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Regression introduced in commit e4cb12a710457b103a7544c4de5e9fc1b2bd24d8.
This has caused issues at least on Cydia installations. And it should
have been introduced as a lax parsing error, only failing for new
packages, and warn on already installed ones. Otherwise one cannot
easily recover after upgrading to a new dpkg on an affected system.
Reported-by: Jay Freeman <saurik@saurik.com>
Stable-Candidate: 1.17.x
|
|
Contrary to what one would expect, this seems to be causing major issues
in several "modern" filesystems, as it collides with the heuristics and
optimizations that these try to perform.
Disable this by default, but let the builder enable it again in case
this is not a problem on certain systems.
|
|
When there's at least one colon or one dash, we should expect epoch
and revision numbers.
|
|
Warned-by: codespell, spellintian
|
|
Closes: #844348
|
|
|
|
|
|
Automatically decrease xz encoder threads to try to not exceed available
memory limits. This should alleviated the insane requirements of memory
needed on 32-bit architectures with many cores, which results in more
than the userspace addressable memory, when using settings such as
-z9 and/or -Sextreme in dpkg-deb.
Closes: #846564
|
|
The former is way more portable than the latter.
|
|
These are not permitted by deb-version(5), but the code was letting
those through.
|
|
Preallocating for very small fails causes some filesystems to degrade
performance. Do so only for "big enough" files.
Closes: #824636
|
|
Our test run with the setting activated by apt, has not shown any signs
of pitch forks nor angry mobs. Let's switch this by default to auto, so
that the more clear but still hopefully unobtrusive colors can help
people deal with interesting messages, warnings or error conditions.
|
|
Trying to rmdir(2) or unlink(2) a non-existent pathname on at least
Linux returns with EROFS. Handle this case specifically to check if
the pathname exists with access(2).
Closes: #838877
|
|
Remove unused macros and simplify remaining ones given the current usage
in the code base.
|
|
When erroring out inside a recursive error handler the error context
errmsg field was not initialized, which meant the a free() was being
done on a garbage pointer, crashing the program.
Regression introduced in commit 4e1e0e78412060de420d2fa7f8a24231d6eff9bb.
|
|
|
|
The wording was quite confusing on the code flow.
|
|
In case we have to use the emergency buffer because the previous
vasprintf() call failed, we should only return an error code if the
vsnprintf() call on the emergency buffer truncates the output.
|
|
We should not be adding junk to the error context message.
|
|
We do not carry translations for this module, and it makes it pull
libintl for programs that might not use it otherwise.
|
|
The latter requires the local getopt implementation, so we need to
include it even if the system provides a getopt implementation.
|
|
Warned-by: gcc on AIX
|
|
|
|
The ar format is not standardized and some systems might provide a
different format than the one used by dpkg. For example on AIX.
|
|
|
|
Warned-by: clang
|
|
Warned-by: clang
|
|
Warned-by: clang
|
|
This should make it more clear that these are not intended to be used
directly by the TAP test runner. In addition now we can use the proper
name for the .t perl scripts.
|
|
This avoids confusing coverage programs, as the file that actually
contains the main function is the test itself.
|