summaryrefslogtreecommitdiff
path: root/cmdline
Commit message (Collapse)AuthorAgeFilesLines
* check for available space, excluding root reserved blocksDavid Kalnischkies2014-10-151-25/+3
| | | | | | | | | | | We are checking the space requirements for ages, but the check uses the free blocks count, which includes the blocks reserved for usage by root. Now that we use an unprivileged user it has no access to these blocks anymore – and more importantly these blocks are a reserve, they shouldn't be used by apt without special encouragement by the user as it would be bad to have dpkg run out of diskspace and maintainerscripts like man-db skip certain actions if not enough space is available freely.
* don't drop privileges if _apt has not enough rightsDavid Kalnischkies2014-10-152-6/+18
| | | | | | | | | | | | | | | | | Privilege dropping breaks download/source/changelog commands as they require the _apt user to have write permissions in the current directory, which is e.g. the case in /tmp, but not in /root, so we disable the privilege dropping if we deal with such a directory based on idea and code by Michael Vogt. The alternative would be to download always to a temp directory and move it then done, but this breaks partial file support. To resolve this, we could move to one of our partial/ directories, but this would require a lock which would block root from using two of these commands in parallel. As both seems unacceptable we instead let the user choose what to do: Either a directory is setupped for _apt, downloading as root is accepted or – which is potentially even better – an unprivileged user is used for the commands.
* Merge remote-tracking branch 'mvo/feature/acq-trans' into debian/experimentalMichael Vogt2014-10-082-18/+6
|\
| * Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2014-10-071-1/+1
| |\ | | | | | | | | | | | | | | | | | | feature/acq-trans Conflicts: apt-pkg/acquire-item.cc
| * | ensure partial dirs are 0700 and owned by _apt:rootDavid Kalnischkies2014-10-072-18/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Reworks the API involved in creating and setting up the fetcher to be a bit more pleasent to look at and work with as e.g. an empty string for no lock isn't very nice. With the lock we can also stop creating all our partial directories "just in case". This way we can also be a bit more aggressive with the partial directory itself as with a lock, we know we will gone need it.
* | | Rename DropPrivs() to DropPrivileges()Michael Vogt2014-10-072-2/+2
| |/ |/| | | | | Git-Dch: ignore
* | apt-get: Create the temporary downloaded changelog inside tmpdirGuillem Jover2014-10-031-1/+1
|/ | | | | | | | The code is creating a secure temporary directory, but then creates the changelog alongside the tmpdir in the same base directory. This defeats the secure tmpdir creation, making the filename predictable. Inject a '/' between the tmpdir and the changelog filename.
* Test if TMPDIR is a directory in apt-key and if not unset itMichael Vogt2014-09-291-0/+3
| | | | | This prevents a failure in mktemp -d - it will blindly trust TMPDIR and not use something else if the dir is not there.
* Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-291-1/+1
|\ | | | | | | | | Conflicts: apt-pkg/acquire-item.cc
| * generalize Acquire::GzipIndexMichael Vogt2014-09-211-1/+1
| |
* | cleanup partial directory of lists in apt-get cleanDavid Kalnischkies2014-09-271-6/+20
| | | | | | | | | | | | | | | | Not really the intended usecase for apt-get clean, but users expect it to help them in recovery and it can't really hurt as this directory should be empty if everything was fine and proper anyway. Closes: #762889
* | allow fetcher setup without directory creationDavid Kalnischkies2014-09-272-5/+7
| | | | | | | | | | | | | | | | | | | | | | apt-get download and changelog as well as apt-helper reuse the acquire system for their own proposes without requiring the directories the fetcher wants to create, which is a problem if you run them as non-root and the directories do not exist as it greets you with: E: Archives directory /var/cache/apt/archives/partial is missing. - Acquire (13: Permission denied) Closes: 762898
* | store source name and version in binary cacheDavid Kalnischkies2014-09-272-42/+24
| | | | | | | | | | | | | | Accessing the package records to acquire this information is pretty costly, so that information wasn't used so far in many places. The most noticeable user by far is EDSP at the moment, but there are ideas to change that which this commit tries to enable.
* | add and use 'apt-key verify' which prefers gpgv over gpgDavid Kalnischkies2014-09-271-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | gnupg/gnupg2 can do verify just fine of course, so we don't need to use gpgv here, but it is what we always used in the past, so there might be scripts expecting a certain output and more importantly the output of apt-cdrom contains messages from gpg and even with all the settings we activate to prevent it, it still shows (in some versions) a quiet scary: "gpg: WARNING: Using untrusted key!" message. Keeping the use of gpgv is the simplest way to prevent it. We are increasing also the "Breaks: apt" version from libapt as it requires a newer apt-key than might be installed in partial upgrades.
* | miscellaneous small cleanups in apt-keyDavid Kalnischkies2014-09-271-17/+7
| | | | | | | | Git-Dch: Ignore
* | add --readonly option for apt-key advDavid Kalnischkies2014-09-271-5/+4
| | | | | | | | | | | | | | | | Some advanced commands can be executed without the keyring being modified like --verify, so this adds an option to disable the mergeback and uses it for our gpg calling code. Git-Dch: Ignore
* | use only one --keyring in gpg interactionsDavid Kalnischkies2014-09-271-28/+77
| | | | | | | | | | | | | | | | | | We were down to at most two keyrings before, but gnupg upstream plans dropping support for multiple keyrings in the longrun, so with a single keyring we hope to be future proof – and 'apt-key adv' isn't a problem anymore as every change to the keys is merged back, so we have now the same behavior as before, but support an unlimited amount of trusted.gpg.d keyrings.
* | add --secret-keyring option for apt-keyDavid Kalnischkies2014-09-271-0/+11
| | | | | | | | | | | | | | | | | | For some advanced usecases it might be handy to specify the secret keyring to be used (e.g. as it is used in the testcases), but specifying it via a normal option for gnupg might not be available forever: http://lists.gnupg.org/pipermail/gnupg-users/2013-August/047180.html Git-Dch: Ignore
* | allow to specify fingerprints in 'apt-key del'David Kalnischkies2014-09-271-4/+17
| |
* | add a test for apt-key export{,all}David Kalnischkies2014-09-271-2/+2
| | | | | | | | Git-Dch: Ignore
* | respect --keyring also in merged keyring commandsDavid Kalnischkies2014-09-271-8/+10
| | | | | | | | Git-Dch: Ignore
* | support gnupg2 as drop-in replacement for gnupgDavid Kalnischkies2014-09-271-4/+13
| | | | | | | | | | | | If both are available APT will still prefer gpg over gpg2 as it is a bit more lightweight, but it shouldn't be a problem to use one or the other (at least at the moment, who knows what will happen in the future).
* | delay gnupg setup in apt-key until it is neededDavid Kalnischkies2014-09-271-22/+22
| | | | | | | | | | | | 'apt-key help' and incorrect usage do not need a functioning gnupg setup, as well as we shouldn't try to setup gnupg before we actually test if it is available (and print a message if it is not).
* | merge fragment keyrings in apt-key to avoid hitting gpg limitsDavid Kalnischkies2014-09-271-57/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | gnupg has a hardlimit of 40 (at the moment) keyrings per invocation, which can be exceeded with (many) repositories. That is rather misfortune as the longrun goal was to drop gnupg dependency at some point in the future, but this can now be considered missed and dropped. It also means that 'apt-key adv' commands might not have the behaviour one would expect it to have as it mainly operates on a big temporary keyring, so commands modifying keys will break. Doing this was never a good idea anyway through, so lets just hope nothing break too badly. Closes: 733028
* | refactor key removal code to reuse it in next stepDavid Kalnischkies2014-09-271-48/+55
| | | | | | | | Git-Dch: Ignore
* | set a primary-keyring only if we have access to itDavid Kalnischkies2014-09-271-1/+3
| |
* | support (multiple) arguments properly in apt-keyDavid Kalnischkies2014-09-271-27/+27
| |
* | only create new trusted.gpg if directory is writeableDavid Kalnischkies2014-09-271-23/+14
| |
* | all errors should be printed to stderrDavid Kalnischkies2014-09-271-5/+5
| | | | | | | | Git-Dch: Ignore
* | add a (hidden) --quiet option for apt-keyDavid Kalnischkies2014-09-271-4/+10
| |
* | remove leftover debug output from multikey softlinkDavid Kalnischkies2014-09-271-1/+0
| | | | | | | | Git-Dch: Ignore
* | adapt to the new CacheSetHelper APIDavid Kalnischkies2014-09-271-6/+6
| | | | | | | | Git-Dch: Ignore
* | rework cachesets API to allow future extensionDavid Kalnischkies2014-09-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The introduction of Fnmatch showed that each new selector would require multiple new virtual methods in the CacheSetHelper to work correctly, which isn't that great. We now flip to a single virtual method which handles all cases separated by an enum – as new enum values can be added without an ABI break. Great care was taken to make old code work with the new way of organisation, which means in return that you might be bombarded with deprecation warnings now if you don't adapt, but code should still compile and work as before as can be seen in apt itself with this commit. Git-Dch: Ignore
* | mark pkg(All|Dist)Upgrade as deprecatedDavid Kalnischkies2014-09-272-3/+3
| | | | | | | | | | | | | | | | The comment above their definition marks them already as such, so this is only a formalisation of the deprecation and fixes the occurances we have in our own code together with removing a magic number. Git-Dch: Ignore
* | count strings more accurately for statsDavid Kalnischkies2014-09-271-14/+39
| | | | | | | | | | | | | | | | | | | | So far, only the few strings stored in stringitems were counted, but many more strings are directly inserted into the cache. We account for this now by identifying all these different strings and measure their length. We are still not at the correct size of the cache in 'stats' this way, but we are now again a bit closer. Git-Dch: Ignore
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-053-18/+36
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc configure.ac debian/changelog doc/apt-verbatim.ent doc/po/apt-doc.pot doc/po/de.po doc/po/es.po doc/po/fr.po doc/po/it.po doc/po/ja.po doc/po/pt.po po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/tr.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
| * Use heap to allocate PatternMatch to avoid potential stack overflowMichael Vogt2014-09-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | When apt-cache search with many args (> 130) is given the allocation of PatternMatch on the stack may fail resulting in a segmentation fault. By using the heap the max size is much bigger and we also get a bad_alloc expection instead of a segfault (which we can catch *if* this ever becomes a pratical problem). No test for the crash as its not reproducable with the MALLOC_ settings in framework. Closes: 759612
| * Make Proxy-Auto-Detect check for each hostMichael Vogt2014-09-021-0/+16
| | | | | | | | | | | | | | | | | | When doing Acquire::http{,s}::Proxy-Auto-Detect, run the auto-detect command for each host instead of only once. This should make using "proxy" from libproxy-tools feasible which can then be used for PAC style or other proxy configurations. Closes: #759264
| * add dpkg::source-options for dpkg-source invocationDavid Kalnischkies2014-08-261-16/+17
| | | | | | | | | | | | | | | | | | | | | | dpkg-source can be told to enforce signature checks with --require-valid-signature, but while this isn't feasible as default for Debian itself at the moment, a local admin should be able to use it. This commit also fixes the size limit on the construction of the command being called for dpkg-source and dpkg-buildpackage. Closes: 757534
* | Only allow "apt-get build-dep path" when path starts with ./ or /Michael Vogt2014-07-081-2/+7
| | | | | | | | | | | | This avoid the subtle problem that someone might have a directory with the same package name as the build-depends he/she is trying to fetch. Also print a note that the specific file/dir is used.
* | Fix ar and tar code to be LFS-safeGuillem Jover2014-07-082-2/+2
| | | | | | | | | | | | This is an ABI break. Closes: #742882
* | correct 'apt-cache stats' to include moreDavid Kalnischkies2014-06-181-24/+32
| | | | | | | | | | | | | | | | It still doesn't reflect the size the cache has on the disk compared to what is given as total size (90 vs 103 MB), but by counting all structs in we are at least a bit closer to the reality. Git-Dch: ignore
* | cleanup datatypes mix used in binary cacheDavid Kalnischkies2014-06-181-1/+1
| | | | | | | | | | | | | | | | We had a wild mixture of (unsigned) int, long and long long here without much sense, so this commit adds a few typedefs to get some sense in the typesystem and ensures that a ID isn't sometimes computed as int, stored as long and compared with a long long… as this could potentially bite us later on as the size of the archive only increases over time.
* | Merge remote-tracking branch 'donkult/debian/sid' into debian/experimentalMichael Vogt2014-06-182-20/+24
|\| | | | | | | | | Conflicts: apt-private/private-install.cc
| * show our broken packages message in 'apt' solverDavid Kalnischkies2014-06-182-20/+24
| |
* | Merge remote-tracking branch 'mvo/feature/drop-rights' into debian/experimentalMichael Vogt2014-06-182-0/+5
|\ \ | | | | | | | | | | | | | | | Conflicts: apt-pkg/contrib/fileutl.cc apt-pkg/contrib/fileutl.h
| * | DropPrivs in the solvers (just to be on the safe side)Michael Vogt2014-06-112-0/+5
| |/
* | Merge remote-tracking branch 'mvo/feature/hash-stats' into debian/experimentalMichael Vogt2014-06-181-1/+45
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h apt-pkg/deb/debmetaindex.h apt-pkg/pkgcache.cc test/integration/test-apt-ftparchive-src-cachedb
| * | Provide ShowHashTableStats functionMichael Vogt2014-06-181-55/+43
| | |
| * | improve formating of the hash statsMichael Vogt2014-06-181-15/+15
| | |