summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-18Prefer use of O_TMPFILE in GetTempFile if availableDavid Kalnischkies
Not all filesystems implement this feature in all versions of Linux, so this open call can fail & we have to fallback to our old method.
2020-05-13Release 2.1.2, take 2Julian Andres Klode
2020-05-13Fix location of testdeb in added regression testsJulian Andres Klode
2020-05-12Release 2.1.2Julian Andres Klode
2020-05-12SECURITY UPDATE: Fix out of bounds read in .ar and .tar implementation ↵Julian Andres Klode
(CVE-2020-3810) When normalizing ar member names by removing trailing whitespace and slashes, an out-out-bound read can be caused if the ar member name consists only of such characters, because the code did not stop at 0, but would wrap around and continue reading from the stack, without any limit. Add a check to abort if we reached the first character in the name, effectively rejecting the use of names consisting just of slashes and spaces. Furthermore, certain error cases in arfile.cc and extracttar.cc have included member names in the output that were not checked at all and might hence not be nul terminated, leading to further out of bound reads. Fixes Debian/apt#111 LP: #1878177
2020-05-10Dutch program translation updateFrans Spiesschaert
Closes: #960186
2020-05-08Release 2.1.1Julian Andres Klode
2020-05-08Use "po4a --porefs file" instead of undocumented compat nolineDavid Kalnischkies
References: https://github.com/mquinson/po4a/commit/329f472a378d42c7a33e8110e5091be61480a0fc
2020-05-08Drop nowrap from po4a --porefs as it is no longer supportedDavid Kalnischkies
Upstream says it had no effect before, so it seems safe to adapt. References: https://github.com/mquinson/po4a/commit/ac1e97305b6073ed87fa8cf0a2e32f9b1255d0f1
2020-05-08Fix typo in Polish translation of --help messagesArtur Grącki
Also translating two related strings along the way. References: https://github.com/Debian/apt/pull/107
2020-05-08Allow aptitude to MarkInstall broken packages via FromUserDavid Kalnischkies
apt marks packages coming from the commandline among others as protected to ensure the various resolver parts do not fiddle with the state of these packages. aptitude (and potentially others) do not so the state is modified (to a Keep which for uninstalled means it is not going to be installed) due to being uninstallable before the call fails – basically reverting at least some state changes the call made before it realized it has to fail, which is usually a good idea, except if users expect you to not do it. They do set the FromUser option though which has beside controlling autobit also gained the notion of "the user is always right" over time and can be used for this one here as well preventing the state revert. References: 0de399391372450d0162b5a09bfca554b2d27c3d Reported-By: Jessica Clarke <jrtc27@debian.org> on IRC
2020-05-04Release 2.1.0Julian Andres Klode
2020-05-04doc/po: Merge nl with template, update templateJulian Andres Klode
We did not merge nl with the template when we updated it, hence we have quite a bit of churn in that commit and this one.
2020-05-04Merge branch 'pu/wildcards' into 'master'Julian Andres Klode
Reinstate * wildcards See merge request apt-team/apt!118
2020-05-04apt list: Fix behavior of regex vs fnmatch vs wildcardsJulian Andres Klode
Previously (and still in cacheset), patterns where only allowed to start with ? or ~, which ignores the fact that a pattern might just as well start with a negation, such a !~nfoo. Also, we ignored the --regex flag if it looked like this, which was somewhat bad. Let's change this all: * If --regex is given, arguments are always interpreted as regex * If it is a valid package wildcard (name or * characters), then it will be interpreted as a wildcard - this set of characters is free from meaningful overlap with patterns. * Otherwise, the argument is interpreted as a pattern. For a future version, we need to adapt parsing for cacheset and list to use a common parser, to avoid differences in their interpretation. Likely, this code will go into the pattern parser, such that it generates a pattern given a valid fnmatch argument for example.
2020-05-04Reinstate * wildcardsJulian Andres Klode
Reinstate * wildcards as they are safe to use, but do not allow any other special characters such as ? or []. Notably, ? would overlap with patterns, and [] might overlap with future pattern extensions (alternative bracketing style), it's also hard to explain. Closes: #953531 LP: #1872200
2020-05-04Merge branch 'feature/markinstall' into 'master'Julian Andres Klode
Refactor MarkInstall fixing various or-group handling issues See merge request apt-team/apt!117
2020-04-27Protect a package while resolving in MarkInstallDavid Kalnischkies
Strange things happen if while resolving the dependencies of a package said dependencies want to remove the package. The allow-scores test e.g. removed the preferred alternative in favor of the last one now that they were exclusive. In our or-group for Recommends we would "just" not statisfy the Recommends and for Depends we engage the ProblemResolver…
2020-04-27Prefer upgrading installed orgroup membersDavid Kalnischkies
In normal upgrade scenarios this is no problem as the orgroup member will be marked for upgrade already, but on a not fully upgraded system (or while you operate on a different target release) we would go with our usual "first come first serve" approach which might lead us to install another provider who comes earlier – bad if the providers conflict.
2020-04-27Propagate Protected flag to single-option dependenciesDavid Kalnischkies
If a package is protected and has a dependency satisfied only by a single package (or conflicts with a package) this package must be part of the solution and so we can help later actions not exploring dead ends by propagating the protected flag to these "pseudo-protected" packages. An (obscure) bug this can help prevent (to some extend) is shown in test-apt-never-markauto-sections by not causing irreversible autobit transfers. As a sideeffect it seems also to help our crude ShowBroken to display slightly more helpful messages involving the packages which are actually in conflict.
2020-04-27Fail earlier on impossible Conflicts in MarkInstallDavid Kalnischkies
MarkDelete is not recursive as MarkInstall is and we can not conflict with ourselves anyhow, so we can move the unavoidable deletes before changing the state of the package in question avoiding the need for the state update in case of conflicts we can not deal with (e.g. the package conflicts with an explicit user request).
2020-04-27Split up MarkInstall into private helper methodsDavid Kalnischkies
Should be easier to move the code bits around then and it helps in documenting a bit what the blocks do and how they interact (or not).
2020-04-27Discard candidate if its dependencies can't be satisfiedDavid Kalnischkies
We do pretty much the same in IsInstallOk, but here we have already set the state, so we have to unroll the state as well to sort-of replicate the state we were in before this MarkInstall failed.
2020-04-27Refactor and reorder MarkInstall codeDavid Kalnischkies
This fixes no bugs per se, but the idea is to delay more costly changes and check easier things first. It e.g. inhibits the moving of the autobit until we are sure that this MarkInstall call isn't going to fail (e.g. because a dependency isn't satisfiable).
2020-04-27Explore or-groups for Recommends further than firstDavid Kalnischkies
MarkInstall only looks at the first alternative in an or-group which has a fighting chance of being satisfiable (= the package itself satisfies the dependency, if it is installable itself is not considered). This is "hidden" for Depends by the problem resolver who will try another member of the or-group later, but Recommends are not a problem for it, so for them the alternatives are never further explored. Exploring the or-group in MarkInstall seems like the better choice for both types as that frees the problem resolver to deal with the hard things like package conflicts.
2020-04-26Discard impossible candidate versions also for non-installedDavid Kalnischkies
We reseted the candidate for installed packages back to the version which is installed if one of the (critical) dependencies of it is not statisfiable, but we can do the same for non-installed packages by discarding the candidate which beside slightly helping the resolver also improves error messages generated by apt as a sideeffect.
2020-04-26Avoid -Wuseless-cast to intDavid Kalnischkies
Reported-By: gcc -Wuseless-cast Gbp-Dch: Ignore
2020-04-26Add correct std namespace to nullptr_tDavid Kalnischkies
Reported-By: clangd Gbp-Dch: Ignore
2020-04-22Dutch manpages translation updateFrans Spiesschaert
Closes: #956313
2020-04-09Release 2.0.2Julian Andres Klode
2020-04-09Merge branch 'pu/user-agent-include-service' into 'master'Julian Andres Klode
ubuntu: http: Add non-interactive to user agent if run by systemd See merge request apt-team/apt!114
2020-04-09ubuntu: http: Add non-interactive to user agent if run by systemdJulian Andres Klode
Include that apt is being run from a service in the user agent, so traffic can be analysed for interactive vs non-interactive use, and prioritised accordingly. It looks like this now: User-Agent: Debian APT-HTTP/1.3 (2.0.1) non-interactive A previous version included the full service names, but this raised some privacy concerns. LP: #1825000
2020-04-06test/integration/apt.pem: Regenerate with SHA2 hashesJulian Andres Klode
Recent GnuTLS 3.6.11 -> 3.6.13 update in Ubuntu broke our test certificate, it's signed with SHA1. Regenerate with SHA2. openssl req -newkey rsa:2048 -x509 -sha256 -days 36500 -nodes -out apt.crt -keyout apt.key -subj "/CN=localhost/O=APT Testcases GmbH/ST=Some-State/C=DE" cat apt.key apt.crt > test/integration/apt.pem
2020-04-05Fix "string match{ing,es}" and whitespace typo in apt-patterns(7)Chris Leick
2020-04-05German manpage translation updateChris Leick
2020-04-05Fix gramma in apt(8): "by append(+ing) a"Marco Ippolito
Closes: #955412
2020-04-05Dutch program translation updateFrans Spiesschaert
Closes: #955505
2020-03-27Simplified Chinese program translation updateBoyuan Yang
Closes: #955023
2020-03-24Release 2.0.1Julian Andres Klode
2020-03-24Merge branch 'pu/colored-error' into 'master'Julian Andres Klode
Add color highlighting to E:/W:/N: prefixes See merge request apt-team/apt!112
2020-03-24configure-index: Add APT::Color optionJulian Andres Klode
This caused unbound error list growth, because each time we dumped an error, the calls to _config->FindB() inside operator << would add 3 new errors of the form: W: Using unknown config option »apt::color« of type BOOL Hence we are dumping an infinite list of errors, and eventually that list will exceed available memory.
2020-03-24Add color highlighting to E:/W:/N: prefixesJulian Andres Klode
This matches the definitions used by dpkg. Closes: #953527
2020-03-24Merge branch 'pu/analyze-pattern' into 'master'Julian Andres Klode
apt-helper: Add analyze-pattern helper See merge request apt-team/apt!113
2020-03-21Russian program translation updateАлексей Шилин
Closes: #953804
2020-03-21Parse last line in deb file correctly by adding a newlineDavid Kalnischkies
While merging apt-pkg and apt-inst libraries the codepath of handling deb files in apt-pkg was adapted to use the 'old' code from apt-inst instead of fork&exec of dpkg-deb -I. The information we get this way forms the main part of the package stanza, but we add a few semi-optional fields to the stanza to make it look and work more like a stanza we got from a repository. Just be careful with the area where these two parts touch as if, hypothetically, we would stip all newlines around the parts, but forget to add a newline between them later, the two lines around the merge would stick a bit too close together forming one which could result in fun parsing errors if this merged line was previously e.g. a well-formed Depends line and has now extra fluff attached. This codepath has a history with too many newlines (#802553) though, so how likely is it really that it will some day lack one you may ask. References: 6089a4b17c61ef30b2efc00e270b0907f51f352a
2020-03-12apt-helper: Add analyze-pattern helperJulian Andres Klode
The analyze-pattern helper parses a pattern and then renders the parsed pattern, allowing you to analyze how the parser interpreted the string. This can be useful to analyse (yes, analyse-pattern also works) why a pattern is different from aptitude or why it does not work as expected. It can also be used to check if apt has pattern support, although that will miss out on the version shipped in eoan, but who really cares about that longer term anyway?
2020-03-10error: Extract operator<< into error.cc (de-inline it)Julian Andres Klode
Extract the code, and reformat it with clang-format so we can modify it.
2020-03-10Don't crash pattern matching sections if pkg has no sectionDavid Kalnischkies
Packages from third-party sources do not always follow the established patterns of more properly maintained archives. In that case it was a driver package for a scanner&printer device which has only a minimum of info attached, but also minimal non-installed packages do not include sections, so we really shouldn't assume their availability.
2020-03-07Release 2.0.0Julian Andres Klode
2020-03-06Merge branch 'pu/improve-locking-msgs' into 'master'Julian Andres Klode
Pu/improve locking msgs See merge request apt-team/apt!111