summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-09-28Update libapt-pkg5.0 symbols for frontend lockingJulian Andres Klode
2018-09-28pkgCacheFile: Only unlock in destructor if locked beforeJulian Andres Klode
pkgCacheFile's destructor unlocks the system, which is confusing if you did not open the cachefile with WithLock set. Create a private data instance that holds the value of WithLock. This regression was introduced in commit b2e465d6d32d2dc884f58b94acb7e35f671a87fe: Join with aliencode Author: jgg Date: 2001-02-20 07:03:16 GMT Join with aliencode by replacing a "Lock" member that was only initialized when the lock was taken by calls to Lock, UnLock; with the latter also taking place if the former did not occur. Regression-Of: b2e465d6d32d2dc884f58b94acb7e35f671a87fe LP: #1794053 (cherry picked from commit e02297b8e22dae04872fe6fab6dba966de65dbba)
2018-09-28http: Stop pipeline after close only if it was not filled beforeJulian Andres Klode
It is perfectly valid behavior for a server to respond with Connection: close eventually, even when pipelining. Turning off pipelining due to that is wrong. For example, some Ubuntu mirrors close the connection after 101 requests. If I have more packages to install, only the first 101 would benefit from pipelining. This commit introduces a new check to only turn of pipelining for future connections if the pipeline for this connection did not have 3 successful fetches before, that should work quite well to detect broken server/proxy combinations like in bug 832113. (cherry picked from commit df696650b7a8c58bbd92e0e1619e956f21010a96) LP: #1794957
2018-09-28Set DPKG_FRONTEND_LOCKED as needed when doing selection changesJulian Andres Klode
We forgot to set the variable for the selection changes. Let's set it for that and some other dpkg calls. Regression-Of: c2c8b4787b0882234ba2772ec7513afbf97b563a (cherry picked from commit 55489885b51b02b7f74e601a393ecaefd1f71f9c)
2018-09-28Add support for dpkg frontend lockJulian Andres Klode
The dpkg frontend lock is a lock dpkg tries to acquire except if the frontend already acquires it. This fixes a race condition in the install command where the dpkg lock is not held for a short period of time between different dpkg invocations. For this reason we also define an environment variable DPKG_FRONTEND_LOCKED for dpkg invocations so dpkg knows not to try to acquire the frontend lock because it's held by a parent process. We can set DPKG_FRONTEND_LOCKED only if the frontend lock really is held; that is, if our lock count is greater than 0 - otherwise an apt client not using the LockInner family of functions would run dpkg without the frontend lock set, but with DPKG_FRONTEND_LOCKED set. Such a process has a weaker guarantee: Because dpkg would not lock the frontend lock either, the process is prone to the existing races, and, more importantly, so is a new style process. Closes: #869546 [fixups: fix error messages, add public IsLocked() method, and make {Un,}LockInner return an error on !debSystem] (cherry picked from commit c2c8b4787b0882234ba2772ec7513afbf97b563a) LP: #1781169
2018-08-20Support records larger than 32kb in 'apt show'David Kalnischkies
The default buffer size for pkgTagFile is 32kb which should be big enough for everything… expect for enormous lists of provides, resulting in: $ apt show librust-winapi-dev E: Unable to parse package file /var/lib/apt/lists/ftp.br.debian.org_debian_dists_unstable_main_binary-amd64_Packages (2) E: Internal Error, Unable to parse a package record The "apt-cache show" codepath uses instead a max size for all files, which seems a bit excessive, but works – using the max size for the file in question seems most appropriate. The patch is written for the 1.6.y series as a rewrite of the related code in the 1.7.y series (commit bf53f39c9a0221b670ffff74053ed36fc502d5a0) removed this problem before it was reported. Closes: #905527 LP: #1787120
2018-08-20Release 1.6.41.6.4Julian Andres Klode
2018-08-20Revert "Release 1.6.3ubuntu0.1"Julian Andres Klode
This reverts commit ed94a024e14e0fdbd9ea6cabd07063da441bcc02.
2018-08-20Release 1.6.3ubuntu0.11.6.3ubuntu0.1Julian Andres Klode
2018-08-20clear alternative URIs for mirror:// between steps (CVE-2018-0501)David Kalnischkies
APT in 1.6 saw me rewriting the mirror:// transport method, which works comparable to the decommissioned httpredir.d.o "just" that apt requests a mirror list and performs all the redirections internally with all the bells like parallel download and automatic fallback (more details in the apt-transport-mirror manpage included in the 1.6 release). The automatic fallback is the problem here: The intend is that if a file fails to be downloaded (e.g. because the mirror is offline, broken, out-of-sync, …) instead of erroring out the next mirror in the list is contacted for a retry of the download. Internally the acquire process of an InRelease file (works with the Release/Release.gpg pair, too) happens in steps: 1) download file and 2) verify file, both handled as URL requests passed around. Due to an oversight the fallbacks for the first step are still active for the second step, so that the successful download from another mirror stands in for the failed verification… *facepalm* Note that the attacker can not judge by the request arriving for the InRelease file if the user is using the mirror method or not. If entire traffic is observed Eve might be able to observe the request for a mirror list, but that might or might not be telling if following requests for InRelease files will be based on that list or for another sources.list entry not using mirror (Users have also the option to have the mirror list locally (via e.g. mirror+file://) instead of on a remote host). If the user isn't using mirror:// for this InRelease file apt will fail very visibly as intended. (The mirror list needs to include at least two mirrors and to work reliably the attacker needs to be able to MITM all mirrors in the list. For remotely accessed mirror lists this is no limitation as the attacker is in full control of the file in that case) Fixed by clearing the alternatives after a step completes (and moving a pimpl class further to the top to make that valid compilable code). mirror:// is at the moment the only method using this code infrastructure (for all others this set is already empty) and the only method-independent user so far is the download of deb files, but those are downloaded and verified in a single step; so there shouldn't be much opportunity for regression here even through a central code area is changed. Upgrade instructions: Given all apt-based frontends are affected, even additional restrictions like signed-by are bypassed and the attack in progress is hardly visible in the progress reporting of an update operation (the InRelease file is marked "Ign", but no fallback to "Release/Release.gpg" is happening) and leaves no trace (expect files downloaded from the attackers repository of course) the best course of action might be to change the sources.list to not use the mirror family of transports ({tor+,…}mirror{,+{http{,s},file,…}}) until a fixed version of the src:apt packages are installed. Regression-Of: 355e1aceac1dd05c4c7daf3420b09bd860fd169d, 57fa854e4cdb060e87ca265abd5a83364f9fa681 LP: #1787752
2018-07-09Release 1.6.31.6.3Julian Andres Klode
2018-07-09Handle JSON hooks that just close the file/exit and fix some other errorsJulian Andres Klode
JSON hooks might disappear and the common idiom to work around hooks disappearing is to check for the hook in the shell snippet that is in the apt.conf file and if it does not exist, do nothing. This caused APT to fail however, expecting it to acknowledge the handshake. Ignoring ECONNRESET on handshakes solves the problem. The error case, and the other error cases also did not stop execution of the hook, causing more errors to pile up. Fix this by directly going to the closing part of the code. LP: #1776218 (cherry picked from commit 1d53cffad22c92645090e0e6ddde31fe4f7c3b05)
2018-06-25Release 1.6.21.6.2Julian Andres Klode
2018-06-25gitlab-ci: chmod 755 /rootJulian Andres Klode
This should avoid test failures on ubuntu:bionic (cherry picked from commit 3a37521aec0b02e12deaef58772ae0bca9a75496)
2018-06-25gitlab-ci.yml: Also pull in ninja-build for 1.6.yJulian Andres Klode
We don't use ninja to build the package in 1.6.y, so we need to pull it in manually.
2018-06-25CI: Export DEBIAN_FRONTEND=noninteractive in all CI environmentsJulian Andres Klode
This ensures that we don't hang waiting for debconf. (cherry picked from commit 551ded4b63f6f47f022c5ca841031fc2566a58ff)
2018-06-25Fix lock counting in debSystemJulian Andres Klode
debSystem uses a reference counted lock, so you can acquire it multiple times in your applications, possibly nested. Nesting locks causes a fd leak, though, as we only increment the lock count when we already have locked twice, rather than once, and hence when we call lock the second time, instead of increasing the lock count, we open another lock fd. This fixes the code to check if we have locked at all (> 0). There is no practical problem here aside from the fd leak, as closing the new fd releases the lock on the old one due to the weird semantics of fcntl locks. (cherry picked from commit 79f012bd09ae99d4c9d63dc0ac960376b5338b32)
2018-06-25apt-key: Pass all instead of gpg-agent to gpgconf --killJulian Andres Klode
We want to kill everything using our temporary directory. LP: #1773992 (cherry picked from commit 819426013c6ca6310bb469440702b6295dba4498)
2018-06-25gitlab-ci: Run on ubuntu:bionic for 1.6.yJulian Andres Klode
Gbp-Dch: ignore
2018-06-25Lower default timeout from 120s to 30sJulian Andres Klode
120s is an insanely high default time out, lower it to 30s to make things a bit nicer. (cherry picked from commit 329a4a6159f1972ff5ec7bc2db26430f26dc61f3)
2018-06-25Handle a missed case of timed out ip addressesJulian Andres Klode
Correctly register timed out IP addresses from a timed out select() call as a bad address so we do not try it again. LP: #1766542 (cherry picked from commit 71b65b3563d223f6cd69261918ec06d10da48e6c)
2018-06-25Fix hidden test failure if not called via sudoDavid Kalnischkies
id: '': no such user ./test-bug-611729-mark-as-manual: 59: [: Illegal number: Regression-of: 68842e1741a5005b1e3f0a07deffd737c65e3294 Gbp-Dch: Ignore (cherry picked from commit ea901a491bcfe406267c7c38c227c5caabf017a0)
2018-06-25Run tests on GitLab CIJulian Andres Klode
Salsa has support for GitLab CI. This introduces a test setup for it, derived from the ones for shippable and travis. It is not optimal yet: The build is run in the test stage. Fixing this requires us to separate test from build dependencies, and storing build/ as an artifact of the build stage; since build and test stage run on different runners with fresh checkouts and images. (cherry picked from commit 8cc38267809a15ec9819bce721e52fcd90a523b9)
2018-06-25tests: Do not expect requested-by if sudo was invoked by rootJulian Andres Klode
If sudo was invoked by root, SUDO_UID will be 0, and apt will not print a Requested-By line. (cherry picked from commit 68842e1741a5005b1e3f0a07deffd737c65e3294)
2018-06-25Fix build with new gtestJulian Andres Klode
Still allow the older one to be used. Closes: #897149 (cherry picked from commit 39d9e217a22901892647499ee695ba472a111d25)
2018-04-20Release 1.6.11.6.1Julian Andres Klode
2018-04-20apt.conf.autoremove: Catch some new Ubuntu module packagesJulian Andres Klode
2018-04-20CMake: Fix builds without zstdJulian Andres Klode
Only use zstd defined variables if zstd was found.
2018-04-18Release 1.61.6Julian Andres Klode
2018-04-18Point debian-branch to 1.6.yJulian Andres Klode
2018-04-18Make libzstd optional in CMakeLists.txt, to aid cross-buildingJulian Andres Klode
This makes cross-building a bit easier, and also porting to other platforms. (cherry picked from commit 7d6994799f6782ba5e024ad0861e036d93e5f447)
2018-04-15Release 1.6~rc11.6_rc1Julian Andres Klode
2018-04-15French man pages translationjean-pierre giraud
[jak: Fix invalid empty line] Closes: #895117
2018-04-15Revert "mention mirror method in sources.list"Julian Andres Klode
This reverts commit 57a00c50b14a49ed91816e3f4467e0f2e57ee772.
2018-04-15Merge branch 'pu/heavy-hooks' into 'master'Julian Andres Klode
json-based hooks for apt cli tools See merge request apt-team/apt!10
2018-04-15Introduce experimental new hooks for command-line toolsJulian Andres Klode
This allows third-party package managers like snap or flatpak to hook in and suggest alternatives if packages could not be found, for example. This is still highly experimental and the protocol might change in future versions.
2018-04-15Merge branch 'pu/zstd' into 'master'Julian Andres Klode
pu/zstd See merge request apt-team/apt!8
2018-04-13zstd: Implement support for multi-frame filesJulian Andres Klode
This implements support for multi frame files while keeping error checking for unexpected EOF working correctly. Files with multiple frames are generated by pzstd, for example.
2018-04-13Implement compression level handling for zstdJulian Andres Klode
This is a simplified variant of the code for xz, adapted to support multiple digit integers.
2018-04-13apt-private: Collect not found packages in CacheSetHelperAPTGetJulian Andres Klode
Collecting the packages we could not find allows us to pass them to other places.
2018-04-07document Acquire::AllowReleaseInfoChange without extra sDavid Kalnischkies
Reported-By: Mattia Rizzolo on IRC
2018-04-07mention mirror method in sources.listDavid Kalnischkies
Closes: 679580
2018-04-07set our two libapt libraries to prio:optionalDavid Kalnischkies
The override file already implements this, so we just adapt to reality. Reported-By: lintian excessive-priority-for-library-package
2018-04-07fix communication typo in https manpageDavid Kalnischkies
Reported-By: lintian spelling-error-in-manpage
2018-04-07catch changelog ↔ NEWS dist mismatches in release scriptDavid Kalnischkies
At least it tries a little harder. Gbp-Dch: Ignore
2018-04-07remove duplicate changelog lines from 1.6~beta1 entryDavid Kalnischkies
Whatever caused it, lets fix it.
2018-04-06test: export GCOV_ERROR_FILE=/dev/null to make it fail less/no testsJulian Andres Klode
2018-04-06Delete /etc/dpkg/dpkg.cfg.d/excludes on Docker CI imagesJulian Andres Klode
Fixes test suite on Ubuntu docker images.
2018-04-06Allow restart_syscall() syscall in seccomp sandboxesJulian Andres Klode
Closes: #891644
2018-04-06Turn off seccomp sandboxing by defaultJulian Andres Klode
LP: #1732030 Closes: #890489 Fixes meefik/linuxdeploy#869