summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
Commit message (Collapse)AuthorAgeFilesLines
* Copyright changesJulian Andres Klode2026-03-021-1/+1
|
* Introduce JSONL performance counter loggingJulian Andres Klode2026-02-101-0/+153
| | | | | | | | Introduce a scoped object that starts measuring performance counters and then dumps them into a JSONL file for later analysis. Add performance contexts for APT::Solver and pkgDepCache::Init() as starting points.
* macros: Introduce must_succeed() macroJulian Andres Klode2026-01-051-0/+8
| | | | | This is like assert() but never compiled out so can be used with function calls that have side effects.
* weakptr: Simplify destructor to use range-based forJulian Andres Klode2025-11-101-3/+2
| | | | Explicit iterators considered harmful :)
* Move split() to APT::String::Split()Julian Andres Klode2025-10-252-0/+12
| | | | This splits based upon contiguous whitespace as separators
* configuration: Add MoveSubTree with overwrite=falseJulian Andres Klode2025-10-252-3/+13
|
* Correctly append or remove FD_CLOEXECJulian Andres Klode2025-10-201-2/+6
| | | | | Rather than just setting the flags to 0 or FD_CLOEXEC, read the current value and append or remove as needed.
* ExecFork: Simplify closing and make it safeJulian Andres Klode2025-10-201-31/+19
| | | | | | | | | Implement a wrapper around FD_CLOEXEC and use it in place of the raw fcntl(). This wrapper _Exit()s the child if the operation failed. Restructure the close_range() handling to simply mark all fds for closing first and then "reopen" the ones we should keep.
* Add some comments and tests around Keep-Fd orderingJulian Andres Klode2025-10-201-0/+1
|
* ExecFork: Use close_range() if availableJulian Andres Klode2025-10-201-2/+32
| | | | | | | | | | | | | Use close_range() if we have it in preference to iterating over /proc/self/fd and falling back to closing all possible fds. This builds sets of ranges to close that take into account the APT::Keep-Fds vector, and a test case is provided to ensure correctness of the splitting logic. Preference is given to close_range() over /proc as in the optimal case, this results in a single system call!
* Include standard headers to fix clang compiler errorBiswapriyo Nath2025-06-181-0/+1
| | | | | | | | This commit fixes the following compiler errors. apt-pkg/acquire.cc:833:51: error: no template named 'function' in namespace 'std' apt-pkg/contrib/error.cc:198:59: error: no member named 'front_inserter' in namespace 'std' apt-pkg/solver3.h:44:22: error: no template named 'is_trivially_constructible_v' in namespace 'std' methods/http.cc:1029:24: error: no member named 'inserter' in namespace 'std'
* Fix error handling with getlineWalter Lozano2025-05-192-2/+2
| | | | | | | | | | | | | | The function getline is used to read data from different streams, however, the error handling is not accurate. From the man page, getline returns -1 on failure and sets errno accordingly, but the current implementation only checks errno to see if there was a failure. With this approach, in case getline returns success but also sets errno it is consider and error. Fix the issue but also checking the return value of getline. Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
* refactor: Deduplicate and Move SectionInSubTree to ConfigurationJulian Andres Klode2025-02-182-0/+36
| | | | | Deduplicate the copies in a central one, mark it unavailable to external users.
* strutl: Add missing #include <cstdint> [gcc 15]Julian Andres Klode2025-02-181-0/+1
| | | | Closes: #1096322
* Add missing #include <string_view>Julian Andres Klode2025-02-153-0/+3
|
* fileutl: Convert FileFd::d to std::unique_ptrJulian Andres Klode2025-02-152-18/+14
|
* Remove some more unused functionsJulian Andres Klode2025-02-152-51/+0
| | | | Final ABI cleanup before unstable?!
* Run unifdef -DAPT_PKG_ABI=700 againJulian Andres Klode2025-02-153-34/+0
| | | | | main picked up a couple new ifdefs since the branch started; so clean them up again.
* StartsWithGPGClearTextSignature(): don't keep un-written-to pointer to ↵наб2025-02-141-1/+1
| | | | constant string in .data
* flAbsPath(): try to re-use storage of argumentнаб2025-02-141-2/+2
|
* Take const& in flNotFile()наб2025-02-142-2/+2
|
* Take const& in GetLock()наб2025-02-142-2/+2
|
* Take const& in Rename()наб2025-02-142-2/+2
|
* Take const& in {,Real}FileExists()наб2025-02-142-4/+4
|
* string{=> _view} flNotDir(string{=> _view}). Configuration::{Cnd,}Set(Value: ↵наб2025-02-144-12/+12
| | | | string{=> _view})
* Return string_view from Apt::String::Strip(). Take string_view in ↵наб2025-02-143-17/+17
| | | | VectorizeString(), StringSplit(), SubstVar()
* APT::String::* should take string_viewsнаб2025-02-142-26/+13
|
* string{=> _view} flExtension(string{=> _view})наб2025-02-142-8/+8
|
* Drop APT::StringViewнаб2025-02-142-172/+1
|
* APT::StringView -> std::string_view [textonly]наб2025-02-142-6/+5
|
* Bump ABI to 7.0Julian Andres Klode2025-02-141-1/+1
|
* sqv, gpgv: Do not fail if Dir::Etc::Trusted is set and trusted.gpg.d is missingJulian Andres Klode2025-01-221-2/+10
| | | | | | | | | | This should remain a warning case for now. So push the errors to a stack and see if we can find any file. Explictly warn again if Dir::Etc::trusted is set, as it is like _super_ deprecated. Reported-By: Cyril Brulebois <kibi@debian.org> in Bug#1032131
* Remove superseded warning about trusted.gpg fallbackJulian Andres Klode2025-01-211-2/+2
| | | | | | | | | | This warning has been superseded by the missing sources.list notice (which will also become a warning shortly) Adjust the sqv exit to avoid introducing a new spurious "No good signature" that we did not reach before. moo
* proxy: Avoids triggering bounds check in std::string_viewJulian Andres Klode2025-01-141-1/+1
| | | | | Check for empty string_view instead of first byte being '\0'; this otherwise breaks when compiling with higher ABI version.
* Remove leftovers from ftp and rsh/ssh methods removalDavid Kalnischkies2025-01-051-1/+1
| | | | References: fd3684cdbc165ceaa635ed19fcbd231f509b0179
* Remove leftovers of the apt-key removalDavid Kalnischkies2025-01-051-2/+0
| | | | References: a00fbbdb28cc31e78882301c2efe7218583ab4cb
* Drop unused short form APT_IGNORE_DEPRECATEDDavid Kalnischkies2025-01-051-6/+1
| | | | | | Even the long form isn't used much (or currently not at all), but given that the short form is not really working even if it would be used… lets drop it and use the long form if we have to.
* Drop usage of APT_MUSTCHECKDavid Kalnischkies2025-01-053-6/+6
| | | | | nodiscard is a C++17 feature and already used (not just due to my recent changes) in our codebase, so lets drop the last remaining holdouts.
* Drop usage of APT_UNUSEDDavid Kalnischkies2025-01-052-3/+3
|
* Drop APT_DEPRECATED usageDavid Kalnischkies2025-01-052-5/+5
| | | | | | | | C++14 includes the standard attribute, so we can use that instead. Note that we drop the deprecation of {Pkg,Dep}Iterator::operator<< as this is ignored (a friends declaration must be a definition to have attributes) very noisily by GCC >= 12 and the methods can be somewhat useful in debugging if you are to lazy to get APT::Pretty{Pkg,Dep}.
* Drop APT_NORETURN usageDavid Kalnischkies2025-01-053-8/+11
| | | | | [[noreturn]] is a C++11 feature and so we can just use it unconditionally.
* Drop unused FLAG macro and friendsDavid Kalnischkies2025-01-051-6/+4
| | | | | They are rather generic names for macros and have no usage in our codebase at all, so lets remove them for good now.
* Drop the remaining usage of APT_ARRAY_SIZEDavid Kalnischkies2025-01-051-4/+1
| | | | | | That macro is not that useful as it might perhaps once was. Lets prepare dropping it now in favour of more standard ways of working with arrays now.
* Drop usage of macro APT_OVERRIDE for simple overrideDavid Kalnischkies2025-01-053-240/+247
| | | | | | | | | We were rather inconsistent in using it and as our public headers contain deduction guides (a c++17 feature) it seems silly to try to hide a c++11 feature in a macro, so lets stop this charade and drop the macro and while we are changing all these lines lets apply [[nodiscard]] (another c++17 feature) and other suggestions from clang-tidy and formatting for a little more consistency.
* Try stomping a little less on global macro namespaceDavid Kalnischkies2025-01-051-3/+3
|
* methods: Add new sqv methodJulian Andres Klode2024-12-222-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new sqv method uses sequoia's sqv tool to verify files. The tool's interface is quite simple: It returns 0 on success, and prints one line per good signer with the fingerprint. sqv has a configurable crypto policy. We have defined apt-specific override mechanisms for sequoia's standard policy, allowing both users, distributions, and apt package to provide overrides for Sequoia's default policy in meaningful ways. The sqv method will be built and be the standard method for verifying OpenPGP signatures provided that `sqv` is in the PATH during building. It is not built if there was no sqv at build time, so you need a rebuild to enable sqv later on. On the flip side, the gpgv method is always built, but it does need to be always built: If APT::Key::GPGVCommand is set, we need to fallback to it - this is important to support existing users of that interface such as mmdebstrap. Also we want to fall back to it when /usr/bin/sqv disappears - for example in our CI :D A couple of concessions have been made for test suite purposes: - Failure to split a clearsigned file only shows the summary, as the gpgv method also only showed it, and no details why it failed. - We write "Got GOODSIG <fingerprint>" in debug mode to mimic the gpgv code to keep the test suite happy. - In various places in the test suite we assert minimal output from sqv, but sqv's human output is not intended to be stable. This will incur additional work when it breaks. However we do not _parse_ the output, so actual operation of apt is unaffected. A couple of things are suboptimal here: - We are still doing clearsigned splitting ourselves. sqv only has support for detached signatures right now, whereas sqopv has support for clearsigned files as well (but sqopv does not provide any reasons for why signature verification fails or means to set a policy). - Deprecation of algorithms happens on a timebomb basis in sequoia. We have no means to give users warnings ahead of time if their configuration is outdated. We have implemented various bits that probably should be going away: - Fallback to trusted.gpg This is just annoying... - Support for fingerprints in Signed-By (no subkey matching though) The extra work here is arguably less compared to gpgv. - Check the keyring for correctness. With Signed-By everywhere, we should just error out rather than skip broken keyrings. Moo
* Remove GnuTLS and gcrypt supportJulian Andres Klode2024-12-221-140/+0
| | | | | OpenSSL is mandatory now, it is no longer possible to build without https support either.
* hashes, methods: Add OpenSSL backendsJulian Andres Klode2024-12-221-2/+71
| | | | | | | | | | | | | | | | | | | | Introduce an OpenSSL::Crypto backend for the hashes library and an OpenSSL::SSL backend for the TLS support in our https method. Many thanks to curl for showing the way with how to handle a CRL file. There are some memory leaks here with the TlsFd itself as well as the proxy support; and we should reorganize the code to generate the ssl object as late as possible. A peculiar aspect of OpenSSL is that SSL_has_pending() returns 1 even if SSL_read() will fail to read anything and return the equivalent of EAGAIN. We work around this here by also peeking ahead 1 byte. I was running a very high RTT connection from Germany to Australia for testing, and with the peeking it's using negligible amounts of CPU; before that, it was busy looping at 100%. Bad OpenSSL!
* hashes: Add GnuTLS backend, make it defaultJulian Andres Klode2024-12-211-0/+66
| | | | | | | The GnuTLS backend avoids the need to link in libgcrypt, and gets us another certified library people will be happy with. This should be an intermediate step on the road to OpenSSL.
* hashes: Refactor backend into PrivateHashesJulian Andres Klode2024-12-211-55/+82
| | | | Everything is abstracted away now.