Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
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
|
|
Switch current code to use dpkg_ar instead of taking a filename and a
file descriptor arguments.
|
|
This affects old format .deb packages.
Fixes: CVE-2015-0860
Warned-by: afl
Signed-off-by: Guillem Jover <guillem@debian.org>
Stable-Candidate: 1.16.x 1.17.x
|
|
It should make the code more clear, and in many cases it avoids having
to use a temporary variable.
|
|
|
|
Closes: #798324
Warned-by: afl
Reported-by: Jacek Wielemborek <d33tah@gmail.com>
Stable-Candidate: 1.16.x 1.17.x
|
|
Signed-off-by: Niels Thykier <niels@thykier.net>
|
|
That is "" or '', and not the unbalanced `' pair.
|
|
All commands reading archives support this, except for --raw-extract
that does not.
Closes: #616614
Based-on-patch-by: Johannes Schauer <j.schauer@email.de>
|
|
|
|
|
|
|
|
This allows to easily extract the entire control member in tar format,
for further processing.
|
|
|
|
This includes no compression (control.tar) or xz compression
(control.tar.xz).
There's really no point allowing the deprecated lzma, or the inferior
bzip2 at this time, when gzip and xz are superior in either speed or
compression ratio.
|
|
|
|
Make clear that the command requires two arguments, instead of
suggesting only a deb filename is needed, to then requesting a directory
name on a second invocation.
Closes: #718899
|
|
Although the two call sites are doing almost the same, they need
different argument parsing logic, and inlining the code will allow
to print more meaningful bad usage messages.
|
|
|
|
This is not allowed by the format defined in deb(5), but dpkg-deb has
been very lenient all this time. Enforce the correct format by erroring
out in case of misplaced members.
|
|
Print a message when we've found the data member but do not know the
compression, and another one when there's an unknown member before the
data member.
This also stops resetting adminmember to -1 as a temporary sentinel,
so that we don't lose previous state.
|
|
|
|
This clarifies the call sites as to what they want from the extractor,
and abstracts the code to allow for a future switch to an internal tar
extractor instead of requiring an external tar program.
|
|
|
|
|
|
This switches all ad-hoc stderr printing for error notices to the
notice() function.
|
|
As a side effect this mkes the messages more clear as the caller has
more context to describe the error conditions.
Closes: #621763
|
|
|
|
This simplifies the parsing and checking and avoids having to treat the
format versions as floats, which can cause parse errors depending on the
locale (this only affected the old deb format).
|
|
|
|
|
|
Depending on how the stack grows read_line() could go beyond the end
of the buffer when looking for a newline.
|
|
This reduces the amount of relocations on the future shared libdpkg
library. It also makes it easier to refactor the code.
|
|
The external extractor is only used on dpkg-deb -x (and friends), which
is only used by dpkg when extracting the control member. The internal
dpkg tar extractor never warns on timestamps, and there's no point for
dpkg to induce those warnings on the control extraction either.
Closes: #640298
|
|
|
|
This allows to extract the control and file system members of a .deb
into a single directory using the same layout dpkg-deb -b expects for
building a package.
Closes: #552123
|
|
Change --extract to honour --verbose and behave as --vextract.
Closes: #293280
|
|
|
|
To not disturb the global program state we should always chdir(2) in the
childs that actually need it. This will allow in the future to switch
this code to be part of a library.
|
|
This makes the compression and decompression functions be closer to the
buffer api, which always return. For non-blocking I/O, the caller has to
setup a child process.
When using external binaries, we make the filter functions setup that
child process transparently so that the API is uniform.
|
|
Instead of duping them to the stdin and stdout file descriptors, pass
them directly. If the compression functions need the file descriptors
on stdin and stdout, then they will take care of setting them up. This
is only the case when using the external compression binaries.
|
|
read_fail() should only assume a system error if rc < 0. Any positive
value means that we did not manage to read as much data as we wanted
and should result in the "unexpected end of file" message.
|
|
This will allow using type-safe function pointers instead of casting
them around. Replace all exit(3) calls with return statements. Remove
DPKG_ATTR_NORET from function declarations, all functions are expected
to return now.
|
|
This allows to support large files on 32-bit systems were a ‘long int’
type might not be of at least 64-bits. For printing %jd or %jx is used,
and the value is cast to intmax_t.
|
|
|
|
The string was referring to the first header when the string refers to
any header parsed.
|
|
This makes the call sites safe against interrupted I/O.
|
|
|