summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-12-12dpkg-divert: Return from a command function instead of directly exitingGuillem Jover1-2/+2
This makes it possible to perform any necessary normal cleanup before exiting, and unifies the usage with all other command functions.
2015-12-12Use new str_fmt() instead of m_asprintf()Guillem Jover4-21/+8
It should make the code more clear, and in many cases it avoids having to use a temporary variable.
2015-10-18dpkg: Fix varbuf memory leaksGuillem Jover2-0/+3
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
2015-10-18libdpkg: Add varbuf_snapshot() and varbuf_rollback() supportGuillem Jover6-26/+30
This adds a proper interface to snapshot a varbuf state and it rollback so that a common stem can be reused on multiple instances.
2015-10-18Update Ian Jackson's email addressGuillem Jover25-25/+25
2015-09-14perl: Split overlong regexes into multiline extended regexesGuillem Jover1-2/+10
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
2015-09-14t: Fix coding styleGuillem Jover1-1/+1
2015-09-14dpkg: Fix --verify with --rootGuillem Jover1-1/+7
The code was not taking into account the root prefix when verifying pathnames, which resulted in all files failing to verify.
2015-09-14libdpkg, dpkg-divert: Mark unimportant unlink() return code as unwantedGuillem Jover1-1/+1
Make it explicit that we do not care about the return code of these unlink() calls. Warned-by: coverity
2015-08-06doc: Fix typos for --predep-package option nameGuillem Jover1-1/+1
Closes: #794688 Reported-by: Sven Joachim <svenjoac@gmx.de>
2015-07-26Document --yet-to-unpack, --predep-packages and --assert-<feature> commandsGuillem Jover1-7/+8
Both in «dpkg --help» and dpkg(1). Mark them as supported. Prompted-by: Johannes Schauer <j.schauer@email.de>
2015-05-30libdpkg: Rename DPKG_VERSION_ARCH to PACKAGE_RELEASEGuillem Jover5-5/+5
This avoids confusing the project-wide macro with the DPKG_VERSION_ namespaced ones.
2015-05-30dpkg: Honor Conflicts/Breaks/Pre-Depends for packages in unpacked and half ↵Ian Jackson1-0/+5
states Closes: #377860 Signed-off-by: Guillem Jover <guillem@debian.org>
2015-05-30dpkg: Sort PKG_STAT_ switch cases in descending orderGuillem Jover1-3/+3
2015-05-30dpkg: Simplify sehandle handlingGuillem Jover1-15/+7
Remove pointless dpkg_selabel_get_handle() function, rename dpkg_sehandle to sehandle, and change dpkg_selabel_set_context() to access the variable directly.
2015-05-30dpkg: Set the SE Linux file context even without a file type in modeGuillem Jover1-4/+0
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.
2015-05-30dpkg: Fix setting the SE Linux context when a file has a statoverrideGuillem Jover2-12/+16
We need to pass the file type in the mode so that the SE labelling function does anything at all. Closes: #786435
2015-05-19dpkg-deb, dpkg: Do not allow pathnames with embedded newlinesGuillem Jover1-0/+4
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
2015-05-18dpkg: When upgrading, copy over the cached arch-qualified package nameGuillem Jover1-0/+1
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.
2015-05-09dpkg-statoverride: Fix error messages on invalid uid/git/mode syntax errorsGuillem Jover1-3/+3
When parsing command-line arguments we should not say that the error comes from the statoverride file.
2015-04-21src/t: Fix dpkg-divert.t when skipping test due to missing /dev/fullGuillem Jover1-1/+3
We need to restore the admindir permissions or the subsequent non-skipped test will not pass.
2015-04-21Remove some unnecessary includes of assert.hNiels Thykier1-1/+0
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-21dpkg: Use badusage() instead of ohshit() for command-line errorsGuillem Jover1-4/+4
2015-04-21src/t: Fix dpkg-divert.t to work even w/o /dev/fullGuillem Jover1-2/+8
The /dev/full device is not usually available outside of Linux, and we should not rely on it.
2015-04-21src/t: Fix dpkg-divert.t to work on BSD userlandGuillem Jover1-0/+2
On FreeBSD «rm -rf» cannot traverse a directory with mode 000, so we need to remove it beforehand.
2015-04-18debian: Update my copyright yearsGuillem Jover14-13/+14
2015-04-10Consistently use proper quotation marks all over the placeGuillem Jover16-94/+98
That is "" or '', and not the unbalanced `' pair.
2015-04-06dpkg: Add --ctrl-tarfile forwarding command for dpkg-debGuillem Jover1-2/+4
2015-04-01dpkg-statoverride: Do not accept unknown user or group names on --addGuillem Jover1-6/+4
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
2015-04-01dpkg: Rework oldconffsetflags() into pkg_conffiles_mark_old()Guillem Jover5-12/+19
Change the signature to take a pkginfo instead of a list of conffiles. And turn the while loop into a for loop.
2015-04-01libdpkg: Move path removal functions to path-remove moduleGuillem Jover6-105/+2
2015-04-01libdpkg: Rename ensure_pathname_nonexisting() to path_remove_tree()Guillem Jover5-13/+14
2015-03-31Say directory instead of dir in output messagesGuillem Jover1-1/+1
2015-03-31Expand EOF and eof into "end of file" in error messagesGuillem Jover4-6/+11
2015-03-30dpkg: Use dpkg_error_print() instead of explicitly printing a dpkg_errorGuillem Jover1-8/+2
2015-03-30dpkg-query: Do not fail on -W and -l when multiple arguments match a packageGuillem Jover1-8/+19
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
2015-03-30dpkg-query: Use pkg_array_foreach() instead of ad-hoc traversalGuillem Jover1-18/+4
2015-03-30dpkg-statoverride: Set the SE Linux context on --updateGuillem Jover2-0/+9
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
2015-03-30dpkg: Move SE Linux support into a separate fileGuillem Jover4-98/+147
This will allow to use the code in dpkg-statoverride, and unclutters the tar handling code.
2015-02-11dpkg: Fix --audit to report missing and empty architecture fieldsGuillem Jover1-1/+1
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.
2015-02-08dpkg: Add comment describing pkg_istobe valuesGuillem Jover1-0/+5
2015-02-08dpkg: Warn on obsolete '<' and '>' operators in --compare-versionsGuillem Jover1-2/+7
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.
2015-01-28dpkg: Fix indentationGuillem Jover1-2/+2
2015-01-28test: Move use strict and warnings as the first directivesGuillem Jover1-3/+5
2015-01-28Remove trailing newline from string literal in warning callsGuillem Jover1-1/+1
2015-01-28Switch code to use the new C locale character type functionsGuillem Jover4-14/+23
2015-01-26Remove unused <ctype.h> includesGuillem Jover4-4/+0
2015-01-26libdpkg: Change m_calloc() signature to take also a nmemb argumentGuillem Jover1-2/+2
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.
2015-01-26dpkg-query: Only trim trailing "/" and "/." from pathnames in --searchGuillem Jover1-14/+9
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.
2014-12-27libdpkg, dpkg: Fix out-of-bounds read accessesGuillem Jover1-1/+2
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>