summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* eipp: include global errors in reported errorDavid Kalnischkies2016-06-272-6/+12
| | | | Git-Dch: Ignore
* eipp: implement Immediate-Configuration flagDavid Kalnischkies2016-06-275-3/+38
| | | | | | | | | APT has 3 modes: no immediate configuration, all packages are configured immediately and its default mode of configuring essentials and pseudo-essentials immediately only. While this seems like a job of different planers at first, it might be handy to have it as an option, too, in case a planer (like apts internal one) supports different modes where the introduction of individual planers would be counter intuitive.
* eipp: properly handle arch-specific providesDavid Kalnischkies2016-06-272-13/+42
| | | | | The generation of the EIPP request was a bit to strict not generation what would actually be needed to be part of the scenario.
* eipp: make no difference between remove & purgeDavid Kalnischkies2016-06-271-5/+11
| | | | | | | | For the order there is no inherent difference between delete or purge, so we don't tell the planer about this and instead decide in apt if a package should be purged or not which also allows us to not tell the planer about rc-only purges as we can trivially do this on our on as there is no need to plan such purges.
* eipp: provide the internal planer as an external oneDavid Kalnischkies2016-06-2723-27/+530
| | | | | | Testing the current implementation can benefit from being able to be feed an EIPP request and produce a fully compliant response. It is also a great test for EIPP in general.
* eipp: output at most two versions per packageDavid Kalnischkies2016-06-272-20/+81
| | | | | | | | | | | | | We can trim generation time and size of the EIPP scenario considerable if we we avoid telling the planers about "uninteresting" packages. This is one of the simpler but already very effective reductions: Do not tell planers about versions which are neither installed nor are to be installed as they have no effect on the plan we don't need to tell the planer about them. EDSP solvers need to know about all versions for better choice and error messages, but planers really don't. Git-Dch: Ignore
* eipp: implement version 0.1 of the protocolDavid Kalnischkies2016-06-277-1/+446
| | | | | | | | | | | | | | | | | | | | | | | The very first step in introducing the "external installation planer protocol" (short: EIPP) as part of my GSoC2016 project. The description reads: APT-based tools like apt-get, aptitude, synaptic, … work with the user to figure out how their system should look like after they are done installing/removing packages and their dependencies. The actual installation/removal of packages is done by dpkg with the constrain that dependencies must be fulfilled at any point in time (e.g. to run maintainer scripts). Historically APT has a super micro-management approach to this task which hasn't aged that well over the years mostly ignoring changes in dpkg and growing into an unmaintainable mess hardly anyone can debug and everyone fears to touch – especially as more and more requirements are tacked onto it like handling cycles and triggers, dealing with "important" packages first, package sources on removable media, touch minimal groups to be able to interrupt the process if needed (e.g. unattended-upgrades) which not only sky-rocket complexity but also can be mutually exclusive as you e.g. can't have minimal groups and minimal trigger executions at the same time.
* add myself to UploadersDavid Kalnischkies2016-06-271-1/+2
|
* close server if parsing of header field failedDavid Kalnischkies2016-06-271-0/+1
| | | | | | Seen in #828011 if we fail to parse a header field like Last-Modified we end up interpreting the data as response header for coming requests in case we don't rotate to a new server in DNS rotation.
* tests: add epoch-packages to try clean with epochsDavid Kalnischkies2016-06-271-7/+24
| | | | Git-Dch: Ignore
* imbue .diff/Index parsing with C.UTF-8 as wellDavid Kalnischkies2016-06-271-0/+5
| | | | | | | In 3bdff17c894d0c3d0f813d358fc45d7a263f3552 we did it for the datetime parsing, but we use the same style in the parsing for pdiff (where the size of the file is in the middle of the three fields) so imbueing here as well is a good idea.
* Add a apt suggests powermgmt-baseNicolas Le Cam2016-06-271-1/+1
| | | | debian/apt.apt-compat.cron.daily is using on_ac_power utility
* Use the ConditionACPower feature of systemd in the apt-daily serviceNicolas Le Cam2016-06-273-27/+24
| | | | | | | | | | .. instead of hardcoding the functionnality in the apt.systemd.daily script. Also make the compatibility cron job provide the same functionnality for systems that do not use systemd. Closes: #827930
* methods/ftp: Cope with weird PASV responsesJulian Andres Klode2016-06-271-2/+15
| | | | | | | | | | | | wu-ftpd sends the response without parens, whereas we expect them. I did not test the patch, but it should work. I added another return true if Pos is still npos after the second find to make sure we don't add npos to the string. Thanks: Lukasz Stelmach for the initial patch Closes: #420940
* zh_CN.po: update simplified chinese translationZhou Mo2016-06-271-6/+6
|
* imbue datetime parsing with C.UTF-8 localeDavid Kalnischkies2016-06-251-0/+2
| | | | | | | | | | | | | | | | | | | Rewritten in 9febc2b238e1e322dce1f94ecbed46d595893b52 for c++ locales usage and rewritten again in 1d742e01470bba27715a8191c50adde4b39c2f19 to avoid a currently present stdlibc++6 bug in the std::get_time implementation. The later implementation uses still stringstreams for parsing, but forgot to explicitly reset the locale to something sane (for parsing english dates that is), so date and especially the parsing of a number is depending on the locale. Turns out, the French (among others) format their numbers with space as thousand separator so for some reason the stdlibc++6 thinks its a good idea to interpret the entire datetime string as a single number instead of realizing that in "25 Jun …" the later parts can't reasonably be part of that number even through there are spaces there… Workaround is hence: LC_NUMERIC=C.UTF-8 Closes: 828011
* show right binary name in simulation noticeDavid Kalnischkies2016-06-2346-191/+280
| | | | Closes: 825216
* Release 1.3~exp31.3_exp3Julian Andres Klode2016-06-2262-1590/+2723
| | | | Quite a huge churn of new strings.
* add insecure (and weak) allow-options for sources.listDavid Kalnischkies2016-06-2216-73/+211
| | | | | | | | Weak had no dedicated option before and Insecure and Downgrade were both global options, which given the effect they all have on security is rather bad. Setting them for individual repositories only isn't great but at least slightly better and also more consistent with other settings for repositories.
* ensure filesize of deb is included in the hashes listDavid Kalnischkies2016-06-221-0/+3
| | | | | | | Filesize is a silly hash all by itself, but in combination with others it can be a strong opponent, so ensuring that it is in the list of hashes and hence checked by the normal course of action the acquire process takes is a good thing.
* add [weak] tag to hash errors to indicate insufficiencyDavid Kalnischkies2016-06-225-73/+84
| | | | | | | For "Hash Sum mismatch" that info doesn't make a whole lot of difference, but for the new insufficient info message an indicator that while this hashes are there and even match, they aren't enough from a security standpoint.
* better error message for insufficient hashsumsDavid Kalnischkies2016-06-223-7/+72
| | | | | | | | Downloading and saying "Hash Sum mismatch" isn't very friendly from a user POV, so with this change we try to detect such cases early on and report it, preferably before download even started. Closes: 827758
* source: if download is skipped, don't try to unpackDavid Kalnischkies2016-06-221-0/+1
| | | | | If apt decides it can't download a file it is relatively pointless to try to tell dpkg-source to unpack it.
* forbid insecure repositories by default expect in apt-getDavid Kalnischkies2016-06-225-40/+68
| | | | | | | | | | | | | | | With this commit all APT-based clients default to refusing to work with unsigned or otherwise insufficently secured repositories. In terms of apt and apt-get this changes nothing, but it effects all tools using libapt like aptitude, synaptic or packagekit. The exception remains apt-get for stretch for now as this might break too many scripts/usecases too quickly. The documentation is updated and extended to reflect how to opt out or in on this behaviour change. Closes: 808367
* generalize secure->insecure downgrade protectionDavid Kalnischkies2016-06-222-49/+85
| | | | | | | Handling the extra check (and force requirement) for downgrades in security in our AllowInsecureRepositories checker helps in having this check everywhere instead of just in the most common place and requiring a little extra force in such cases is always good.
* handle weak-security repositories as unauthenticatedDavid Kalnischkies2016-06-223-50/+197
| | | | | | | | | | | | | | | | APT can be forced to deal with repositories which have no security features whatsoever, so just giving up on repositories which "just" fail our current criteria of good security features is the wrong incentive. Of course, repositories are better of fixing their setup to provide the minimum of security features, but sometimes this isn't possible: Historic repositories for example which do not change (anymore). That also fixes problem with repositories which are marked as trusted, but are providing only weak security features which would fail the parsing of the Release file. Closes: 827364
* run update post-invokes even on (partial) failuresDavid Kalnischkies2016-06-222-22/+34
| | | | | | | Unsecure repositories result in error messages by default which causes the acquire run to fail hard, but non-failing repositories are still updated just like in the slightly less hard-failures which got this behaviour in 35664152e47a1d4d712fd52e0f0a2dc8ed359d32.
* zh_CN.po: update simplified chinese translationZhou Mo2016-06-211-3/+7
|
* Merge pull request Debian/apt#16 from dombenson/masterJulian Andres Klode2016-06-201-1/+18
|\ | | | | | | Reinstate caching of file hashes in apt-ftparchive
| * Check for cached hash entries to determine which (if any) hash typesDominic Benson2016-06-201-1/+18
| | | | | | | | | | | | | | | | need to be generated for the current file. In 1.0.9, each hash type was handled by a separate method, each of which checked the cache. It looks like when these code paths were unified (in a311fb96b84757ef8628e6a754232614a53b7891) the cache checks were not incorporated into the new method.
* | implement and document DIRECT for auto-detect-proxyDavid Kalnischkies2016-06-204-42/+54
| | | | | | | | | | | | | | There is a subtile difference between an empty setting and "DIRECT" in the configuration as the later overrides the generic settings while the earlier does not. Also, non-zero exitcodes should really be reported as an error rather than silently discarded.
* | do not error if auto-detect-proxy cmd has no outputDavid Kalnischkies2016-06-202-2/+8
| | | | | | | | | | | | | | | | | | | | | | Regression introduced in 8f858d560e3b7b475c623c4e242d1edce246025a. Commands are probably better of always having output through as the fall through to the generic proxy settings is likely not intended. As documenting and implementing this more consistently is kind of a regression through, it is split off into the next commit. Closes: 827713
* | avoid std::get_time usage to sidestep libstdc++6 bugDavid Kalnischkies2016-06-172-36/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported upstream in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71556 the implementation of std::get_time is currently not as accepting as strptime is, especially in how hours should be formatted. Just reverting 9febc2b238e1e322dce1f94ecbed46d595893b52 would be possible, but then we would reopen the problems fixed by it, so instead I opted here for a rewrite of the parsing logic which makes this method a lot longer, but at least it provides the same benefits as the rewrite in std::get_time was intended to give us and decouples us from the fix of the issue in the standard library implementation of GCC. LP: 1593583
* | merge sources.list lines based on Release filenameDavid Kalnischkies2016-06-172-20/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merging by URI means that having sources lines with different URI methods results in 'strange' warning and error messages, which aren't very friendly from a user point of view as not encoding the method in the filename is effectivly an implementation detail. Merging by filename removes these messages and makes everything "work" even if it isn't working the way it is configured as the indexes aren't acquired over the method given, but over the first method for this release file (which argueably is an implementation detail stemming from the filename encoding, too). So either direction isn't perfectly "right", but personally I prefer "magic" over strange error messages (and doing a full-circle detection of this with its own messages which would need to be translated feels like way too much effort for dubious gain). Closes: 826944
* | http: don't hang on redirect with length + connection closeDavid Kalnischkies2016-06-151-4/+4
| | | | | | | | | | | | | | | | Most servers who close the connection do not send a content-length as this is redundant information usually, but some might and while testing with our server and with 'aptwebserver::response-header::Connection' set to 'close' I noticed that http hangs after a redirect in such cases, so if we have the information, just use it instead of discarding it.
* | don't use FindFile for external Dir::Bin commandsDavid Kalnischkies2016-06-143-10/+10
| | | | | | | | | | | | | | | | | | | | We usually use absolute paths to specific the location of dpkg, apt-key and the like, but there is nothing wrong with using just the command name and instead let exec(3) make the lookup in PATH. We had a wild mixture before, so opting for the more accepting option out of the two seems about right especially as it makes no difference in the default case as apt uses absolute paths.
* | apt-key: don't search PATH if command is a path alreadyDavid Kalnischkies2016-06-141-0/+1
| |
* | Norwegian Bokmål program translation updatePetter Reinholdtsen2016-06-131-58/+83
|/ | | | Closes: 827067
* Release 1.3~exp21.3_exp2Julian Andres Klode2016-06-1161-812/+2202
|
* don't leak FD in AutoProxyDetect command return parsingDavid Kalnischkies2016-06-101-35/+20
| | | | | Just closing the fd would be enough, but while we are at it we can also use the Popen interface to have an easier time with this.
* don't leak dpkg statusfd pipe in debuggingDavid Kalnischkies2016-06-101-0/+2
| | | | | | Not a big deal to leak fds in debugging mode, but for completeness. Git-Dch: Ignore
* don't leak EDSP solver output fdDavid Kalnischkies2016-06-102-3/+4
|
* don't leak an FD in lz4 (de)compressionDavid Kalnischkies2016-06-105-2/+72
| | | | | Seen first in #826783, but as this buglog also shows leaked uncompressed files as well we don't close it just yet.
* do not hang on piped input in PipedFileFdPrivateDavid Kalnischkies2016-06-104-3/+42
| | | | | This effects only compressors configured on the fly (rather then the inbuilt ones as they use a library).
* remove racy_pselect fallbackDavid Kalnischkies2016-06-091-122/+86
| | | | | | | | | | | The comment says it should have been removed with Lenny+1 which is a small while ago already, so it seems like a good time now… And as this is a cleanup commit it also gets right of spurious whitespace at the end of lines, adds missing fold markers and similar busy work. Git-Dch: Ignore
* drop Dpkg::MaxArgs in favor of Dpkg::MaxArgsBytesDavid Kalnischkies2016-06-081-27/+5
| | | | | | | | | We had an old FIXME saying that it is probably pointless to do this if we limit by length of the commandline already and I completely agree. The splitting is bad enough if it must be done, so we should only do it if we have to (as in absolute length of commandline) and, but that is just a remark, it is unlikely that we ever have/had a call triggering this as the default value was ~32000 items…
* don't explicitly configure the last round of packagesDavid Kalnischkies2016-06-085-18/+25
| | | | | | | | | | | | We end our operation by calling "dpkg --configure -a", so instead of running a (big) configure run with all packages mentioned explicitly before this, we simply skip them and let them be handled by this call implicitly. There isn't really an observeable gain to be had here from a speed point, but it helps in avoiding an (uncommon) problem of having a too long commandline passed to dpkg, which we would split up (probably incorrectly).
* edsp: drop privileges before executing solversDavid Kalnischkies2016-06-085-9/+21
| | | | | | | | | | | | | | | Most (if not all) solvers should be able to run perfectly fine without root privileges as they get the entire state they are supposed to work on via stdin and do not perform any action directly, but just pass suggestions on via stdout. The new default is to run them all as _apt hence, but each solver can configure another user if it chooses/must. The security benefits are minimal at best, but it helps preventing silly mistakes (see 35f3ed061f10a25a3fb28bc988fddbb976344c4d) and that is always good. Note that our 'apt' and 'dump' solver already dropped privileges if they had them.
* edsp: if logging is requested, do it for internal, tooDavid Kalnischkies2016-06-083-11/+27
| | | | | Create and log the EDSP(like) request even if we use the internal resolver.
* edsp: if internal is used, keep this decisionDavid Kalnischkies2016-06-082-6/+5
| | | | | | | | | It wasn't noticeable before, but now with the (optional) logging it can be observed that we decide in the internal path two times if an internal or external solver should be used (and hence with logging, it is attempted twice), so if we are in the internal path call the internal resolver directly, which means those internal methods need to be public – but we can hide them based on the symbol at least.