summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release 2.9.182.9.18Julian Andres Klode2024-12-195-6/+20
|
* apt show: Add pinning information for --fullJulian Andres Klode2024-12-192-0/+15
| | | | | Add new fields `APT-Pin`, `APT-Candidate`, and `APT-Release` to the output, same as in EDSP (limited to one release for now).
* Be more strict about which PAGER to execvp() directlyJulian Andres Klode2024-12-192-1/+14
| | | | | | | | | | | There could be | or ; or other stuff in PAGER that needs special handling, let's encode a list of known-good characters instead. This covers all known pagers. You could also try to execvp() PAGER in its entirety and if it fails with ENOENT fall back to the shell but then you don't get correct error handling if the pager really doesn't exist (in which case we should abort trying to page).
* Merge branch 'pager' into 'main'Julian Andres Klode2024-12-1913-7/+322
|\ | | | | | | | | Introduce automatic pager for read commands See merge request apt-team/apt!410
| * Introduce automatic pager for read commandsJulian Andres Klode2024-12-1813-7/+322
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automatically show the output of `show`, `policy`, `list`, `search`, `showsrc` in a pager. The pager setup is inspired by git's pager setup. Notably, the pager is found using APT_PAGER and PAGER variables. We wait for the pager to be setup somewhat correctly by using a notify pipe to figure out whether execvp() was succesful - then the pipe will read EOF as the other end got closed by CLOEXEC during exec - or not, then the pipe will contain an errno. We set up the correct handlers for signals and exit to close the fds and wait for the pager. Notably inside the signal handler we cannot flush our streams, only close them, so there is some duplication. We call the InitOutputPager() function from inside the various Do...() functions rather than setting it up generally in InitOutput(). Doing so allows us to first render the progress without a pager, and then setup the pager for the content only which improves user experience. When we setup a pager we also take care to disable standard input, as we should not be prompting users while a pager is running (the pager will be reading from the tty directly). We do this by dup2-ing() a /dev/null over it; if we just close()d the fd, another open() might reuse the fd number and problems could occur.
* | gpgv: Extract VerifyDetachedSignatureFile()Julian Andres Klode2024-12-171-73/+90
|/ | | | | This is a pretty standalone function, extract it for later reuse.
* Fix out-of-bounds read in `apt show :`Julian Andres Klode2024-12-162-0/+7
| | | | | | | | We tried to access str.size() - 1 on a 0-sized string, which does not work, and now that we build with assertions triggers it. Closes: #1090068
* Release 2.9.172.9.17Julian Andres Klode2024-12-0759-4013/+3210
|
* Merge branch 'bye-apt-key' into 'main'Julian Andres Klode2024-12-0715-338/+55
|\ | | | | | | | | Stop using apt-key for verification and move apt-key to test/ See merge request apt-team/apt!406
| * methods/gpgv: Remove apt-key mentionsJulian Andres Klode2024-12-072-5/+5
| |
| * Remove the apt-key manual page and add documentation to apt-secureJulian Andres Klode2024-12-076-273/+37
| | | | | | | | | | | | | | We move the user configuration section to the top of the manual page as that is going to be what most are interested in and rewrite it to cover all the modern ways to configure keys in a succinct way.
| * Stop installing apt-key, make it a test suite helperJulian Andres Klode2024-12-076-56/+9
| |
| * gpgv: Drop references to apt-keyJulian Andres Klode2024-12-071-4/+4
|/
* Merge branch 'gpgv-merge-keyring' into 'main'Julian Andres Klode2024-12-042-24/+28
|\ | | | | | | | | gpgv: Merge all keyrings into a single one again See merge request apt-team/apt!408
| * gpgv: Merge all keyrings into a single one againJulian Andres Klode2024-12-042-24/+28
|/ | | | | | | | | | | | | | | gpgv is quite picky, it takes at most 40 keyrings but it also doesn't even take keyrings with : in the name, generating an ERROR message instead. So instead let's always merge the configured keyrings for the source into a single one. While we are at it, since we are merging now, let's also add some rudimentary error checking to what we write into the merged keyring: If copying into it fails, we should abort. Reported-by: SuShY on IRC
* solver3: Reject all non-candidates outright for strict pinningJulian Andres Klode2024-12-034-30/+24
| | | | | | | | Reimplement strict pinning by rejecting the non-candidates when translating the problem from the depcache to the solver. This is substantially better than restricting the list of alternatives for an or group to only include allowed ones for debugging purposes, albeit a bit slower.
* solver3: Add a missing debug level checkJulian Andres Klode2024-12-031-1/+2
|
* solver3: Fix intransitivity of version comparison on upgradeJulian Andres Klode2024-12-022-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | We only compared candidate to installed version, but candidate should dominate all versions, otherwise we end up in the fancy problem of elpa-notmuch in upgrade-noble-t64-remove-desktop-2024-03-29.edsp Where we had three versions: not-installable 0.38.3-1ubuntu1 candidate 0.38.2-1.1ubuntu2 installed 0.38.2-1ubuntu2 And received an ordering: installed > non-installable > candidate despite candidate > installed This is only visible with no-strict-pinning right now, as we are otherwise filtering out invalid choices (and hence we only have candidate and installed otherwise).
* Release 2.9.162.9.16Julian Andres Klode2024-11-295-6/+14
|
* Avoid extension check for .gpgJulian Andres Klode2024-11-291-12/+12
| | | | | | | | | | | | We only ever documented .gpg and .asc and have ensured that only such files exist in the keyring, but people can set the Signed-By option to keys with any random extension, as that was not validated before by apt-key. This doesn't change the behavior for trusted.gpg.d: We filter the directory listing and only look at .gpg and .asc files. Closes: #1088656
* Release 2.9.152.9.15Julian Andres Klode2024-11-286-6/+38
|
* Merge branch 'prep-bye-apt-key' into 'main'Julian Andres Klode2024-11-2811-90/+313
|\ | | | | | | | | Stop using apt-key See merge request apt-team/apt!407
| * Detect working gpgv using gpgv --dump-optionsJulian Andres Klode2024-11-283-43/+71
| | | | | | | | | | | | | | | | | | | | | | | | This gains us support for not using an absolute path, which is nice, and we can now cache the invocation across fork() in the method. Still keep preferring absolute paths, this avoids execvp() having to iterate the path and reduces bug potential with custom gpgv in /usr/local. Fix the last entry in the list of gpgvs to say gpgv1
| * fileutl: Use execvp() in Popen() instead of execv()Julian Andres Klode2024-11-282-2/+2
| |
| * gpgv: Add direct support for --assert-pubkey-algoJulian Andres Klode2024-11-281-0/+23
| |
| * Directly call gpgv instead of apt-keyJulian Andres Klode2024-11-283-46/+40
| |
| * gpgv: Verify keyrings and dearmor outside apt-keyJulian Andres Klode2024-11-281-5/+54
| |
| * strutl: Add Base64DecodeJulian Andres Klode2024-11-283-1/+88
| | | | | | | | | | | | | | | | Lifted from the dpkg mtree code that mjg59 submitted in https://lists.debian.org/debian-dpkg/2018/05/msg00005.html Which as dpkg is GPL-2.0+ also is GPL-2.0+
| * gpgv: Use std::string instead of const char *Julian Andres Klode2024-11-281-39/+33
| | | | | | | | | | This is a bit more overhead here, but if we need to build temporary strings this is a lot cleaner.
| * gpgv: Explictly pass all the keyrings to gpgv from aptJulian Andres Klode2024-11-281-3/+40
| |
| * apt-key: Temporarily accept 'pub' as an extension for binary gpg keysJulian Andres Klode2024-11-281-1/+1
| |
| * apt-key: Only cat supported keyrings into the merged oneJulian Andres Klode2024-11-281-1/+3
| |
| * Do not implode key file name vector for calling gpgvJulian Andres Klode2024-11-283-4/+11
| | | | | | | | Converting it to a comma-separated string and back loses precision.
| * gpgv: Generalize apt_error to apt_msg(), add apt_warning()Julian Andres Klode2024-11-281-3/+5
|/ | | | This allows printing warnings and errors,
* tagfile: Avoid uninitialized variable warningsJulian Andres Klode2024-11-281-9/+9
|
* Fix accidental ABI break in debListParser::ParseDependsJulian Andres Klode2024-11-282-0/+25
| | | | | The version that accepted APT::StringView was marked public.
* test-apt-cdrom: Hande assert-pubkey-algo like other gpgv messagesJulian Andres Klode2024-11-241-18/+2
| | | | | | Not all gpgv implementations support that flag and we no longer default to gpgv; so we may not have support for it, so let's just handle it like other gpgv messages.
* Merge branch 'fix/collect-ignored-errors' into 'main'Julian Andres Klode2024-11-224-19/+86
|\ | | | | | | | | Collect unprinted Ign errors for display in Err output See merge request apt-team/apt!405
| * Collect unprinted Ign errors for display in Err outputDavid Kalnischkies2024-11-224-19/+86
|/ | | | | | | | | | | | | | | | Instead of deciding if the first or the last error in a retry chain is the best one to display if the entire chain fails in the end we teach our progress reporting to collect the ignored errors (if it hasn't shown them) and print them all together in the Err line. We de-duplicate the collection which makes it harder to match the Ign line with the error messages, but for these cases its probably better to enable direct display of the text anyhow – and repeating the same message multiple times is boring and probably not that helpful for a user wanting to know why all the downloads failed even they asked apt to retry 429 times… References: 841243df877b39dfcb907a7fab9c4e8b4f65d715
* Release 2.9.142.9.14Julian Andres Klode2024-11-225-6/+45
| | | | | Oh well I accidentally committed everything from my work email today but I'm off today ...
* apt-key: Prefer gpgv-sq if it existsJulian Andres Klode2024-11-221-0/+1
| | | | | This allows you to test out gpgv-sq by just installing it, which is nice.
* Merge branch 'fix/partialfilemirror' into 'main'Julian Andres Klode2024-11-2217-286/+602
|\ | | | | | | | | Support uncompressed indexes from partial file:/ mirrors See merge request apt-team/apt!235
| * Look at non by-hash paths in copy and file methodsDavid Kalnischkies2024-11-228-102/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ideally copy and file mirrors would support by-hash as well, but its harder to setup and maintain especially if you want to cache an online mirror who has by-hash enabled. We can avoid unneeded roundtrips (in the best case) and entire cache misses (in the usual worst case) by "just" telling methods that the URI we passed it has the requested file perhaps also in other paths. This is done in pseudo-relative paths as we would otherwise need to teach redirection code to rewrite those URIs as well. A method like http can easily ignore this value and await explicit instructions to look at that file, but inspecting the path in local sources via file or copy is (comparatively) free, so we just do it immediately. If that ends up being the wrong version of the file as by-hash would have protected us from we are in this feature branch now falling back to other mirrors which are like the ones online and in support of by-hash.
| * Allow HashSum mismatches to fallback to other mirrorsDavid Kalnischkies2024-11-223-48/+94
| | | | | | | | | | | | | | | | | | | | | | Perhaps a common error in the past nowadays thanks to by-hash we rarely get mismatches due to our calling behaviour and more because the mirror is genuinely bad especially if this mirror didn't work with by-hash. Using our "normal" error handling allows falling back to other mirrors which hopefully do support by-hash and/or are not broken on a filesystem level making us more resistent to the occasional bad apple in a wild mirror forest.
| * Never consider file/copy/cdrom sources bad sites due to errorsDavid Kalnischkies2024-11-223-3/+14
| | | | | | | | | | | | | | | | | | | | | | As the hostname for them is likely empty (for absolute or . or .. for relative paths) considering one a bad site causes all of the sites from this scheme to be considered bad. In a perfect world, we would figure out a good site-path to use for these sources, but as they are local sources which means we don't have to perform costly requests to the internet we just let them happen instead for now.
| * Clear previous ignored errors before processing acquire item againDavid Kalnischkies2024-11-221-0/+4
| | | | | | | | | | | | | | | | If an item failed previously, but that failure is ignored and a retry is triggered we might end up in a situation in which it is failing yet again for perhaps totally different reasons, but the error message displayed is the one we have shown (or, because it was ignored likely hidden) before which can be rather confusing in debugging.
| * Do not change UsedMirror on local copy of InReleaseDavid Kalnischkies2024-11-221-1/+1
| | | | | | | | | | | | | | | | While we pick most files from the file:/ mirror directly, we explicitly bring in the InRelease file with a copy one if-clause later, which causes this code to be run again and ends up considering the copy:/ the mirror the file was picked up from, which works, but isn't what we had signed up for.
| * Do not assume mirror-URIs end in a filename causing a hangDavid Kalnischkies2024-11-222-3/+23
| | | | | | | | | | | | | | In practice most of them will, but making the acquire process hang in response if they don't seems like an overly excessive response if we can just support it gracefully to reply with an error (or actually succeed in the unlikely event this URI is actually correct).
| * Allow AutoDetectProxy to work with more than just http(s)David Kalnischkies2024-11-225-39/+93
| | | | | | | | | | | | | | | | It is a bit unfair for third-party methods wrapping e.g. http to not have access to such tools, same for our old ftp and e.g. our tor even if in practice this isn't used much even for http. At least that is one less FIXME in the code.
| * Rewrite hidden config option checker for more patternsDavid Kalnischkies2024-11-223-54/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | The previous version allowed only foo::*::bar as a pattern, now you can have as many starred parts as you want allowing for a finer control instead of hardcoding specific common star-values or giving up with **. It also adds a new INVALID type for an option to mark options which should not be used, but are covered by a pattern which would normally allow it. Our tests are more or less the only users of this hidden feature making this change not very risky even through it has no dedicated test itself.