summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* move 'dump' solver from apt-utils to apt packageDavid Kalnischkies2016-06-083-4/+4
|
* edsp: optionally store a compressed copy of the last scenarioDavid Kalnischkies2016-06-0810-78/+232
| | | | | | | | For bugreports and co it could be handy to have the scenario and all the settings used in it around later for inspection for EDSP like protocols. EDSP might not be the most interesting as the user can still interrupt the process before the solution is applied and users tend to have an opinion on the "rightness" of a solution, so it is disabled by default.
* edsp: prevent it from trying to write a cacheDavid Kalnischkies2016-06-061-0/+6
| | | | | | | | | | | | | | | EDSP(-like) protocols are one-shot processes working on data which exists only as long as they run (as they get feed via a pipe), so trying to write a cache for it is pretty pointless, especially as it will usually fail as the cache files tend to be owned by root, but the process is run as a unpriviledged user (either _apt if called by root, otherwise the user of the caller). So this was in fact only observeable with our testcases which run as non-root and the worst which happens is that a valid cache is overridden with an invalid one which the next run will detect and not use. Git-Dch: Ignore
* get right of the hardcoded string-length comparesDavid Kalnischkies2016-06-061-40/+28
| | | | | | | | | With have better ways to compare, manipulate and work with strings, so use it instead of counting string length by hand with is a wonder it hasn't failed yet. Ignoreable from a changelog perspective as there is no behaviour change. Git-Dch: Ignore
* refactor EDSP classes for better internal reuseDavid Kalnischkies2016-06-056-150/+145
| | | | | | | | | The classes are all marked as hidden, so changing them is no problem ABI wise and will help with introducing protocols similar to EDSP. The change has no observeable behavior difference, its just code juggling. Git-Dch: Ignore
* prepare-release: ignore newer version symbolsDavid Kalnischkies2016-06-041-1/+1
| | | | | | | | | | The script takes the version from the changelog, but if it lacks behind and the symbols file already includes symbols tagged for the next version the helper prints incorrect lines as NEW for these symbols, but ideally it shouldn't print them at all as the symbol is already dealt with. Git-Dch: Ignore
* Japanese program translation updateTakuma Yamada2016-06-041-16/+27
| | | | Closes: 826291
* edsp: use a stanza based interface for solution writingDavid Kalnischkies2016-06-044-39/+34
| | | | | | | | EDSP had a WriteSolution method to write out the entire solution based on the inspection of a given pkgDepCache, but that is rather inflexible both for EDSP itself and for other EDSP like-protocols. It seems better to use a smaller scope in printing just a single stanza based on a given version as there is more reuse potential.
* edsp: use an ID mapping for the internal solverDavid Kalnischkies2016-06-045-9/+42
| | | | | | | Currently an EDSP solver gets send basically all versions which means the absolute count is the same, but that might not be true forever (and with the skipping of rc-only versions it kinda is already) and even if it were true, segfaulting on bad input seems wrong.
* apt-key: change to / before find to satisfy its CWD needsDavid Kalnischkies2016-06-022-120/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First seen on hurd, but easily reproducible on all systems by removing the 'execution' bit from the current working directory and watching some tests (mostly the no-output expecting tests) fail due to find printing: "find: Failed to restore initial working directory: …" Samuel Thibault says in the bugreport: | To do its work, find first records the $PWD, then goes to | /etc/apt/trusted.gpg.d/ to find the files, and then goes back to $PWD. | | On Linux, getting $PWD from the 700 directory happens to work by luck | (POSIX says that getcwd can return [EACCES]: Search permission was denied | for the current directory, or read or search permission was denied for a | directory above the current directory in the file hierarchy). And going | back to $PWD fails, and thus find returns 1, but at least it emitted its | output. | | On Hurd, getting $PWD from the 700 directory fails, and find thus aborts | immediately, without emitting any output, and thus no keyring is found. | | So, to summarize, the issue is that since apt-get update runs find as a | non-root user, running it from a 700 directory breaks find. Solved as suggested by changing to '/' before running find, with some paranoia extra care taking to ensure the paths we give to find are really absolute paths first (they really should, but TMPDIR=. or a similar Dir::Etc::trustedparts setting could exist somewhere in the wild). The commit takes also the opportunity to make these lines slightly less error ignoring and the two find calls using (mostly) the same parameters. Thanks: Samuel Thibault for 'finding' the culprit! Closes: 826043
* ignore std::locale exeception on non-existent "" localeDavid Kalnischkies2016-06-023-2/+12
| | | | | | | | In 8b79c94af7f7cf2e5e5342294bc6e5a908cacabf changing to usage of C++ way of setting the locale causes us to be terminated in case of usage of an ungenerated locale as LC_ALL (or similar) – but we don't want to fail here, we just want to carry on as before with setlocale which we call in that case just for good measure.
* Pass -fvisibility-inlines-hidden to g++Julian Andres Klode2016-06-013-127/+2
| | | | | | | | | | | | | | This reduces the number of symbols by about 10%. Unfortunately, it does not seem to cover all the weird std::vector and friend template expansions. ABI should not brake due to that change: It was never specified before whether an inline symbol was exported or not; so no library could rely on its presence. Instead, the symbols were exported in each library/program needing it and and then merged into a common one by the dynamic linker. Also update the symbol files to account for the removed symbols.
* Add some more symbols to libapt-pkg5.0.symbolsJulian Andres Klode2016-06-011-0/+4
| | | | | | | David added some more when he changed the output format for numbers. Gbp-Dch: ignore
* Get rid of .bzrignoreJulian Andres Klode2016-06-011-30/+0
| | | | Gbp-Dch: ignore
* try to detect sudo spawned root-shell in prefixingDavid Kalnischkies2016-05-291-2/+7
| | | | | | | | | | | | | | | | It is a try as the we need to inspect SUDO_COMMAND which could be anything – apt, apt-get, in /usr/bin, in a $DPKG_ROOT "chroot", build from source, aliases, … The best we can do is look if the SHELL variable is equal to the SUDO_COMMAND which would mean a shell was invoked. That isn't fail-safe if different shells are involved as sub-shells have the tendency of not overriding the SHELL so a bash started from within zsh can happily pretend to be still zsh, so we could have a look at /etc/shells for a list, but oh well, we have to stop somewhere I guess. This sudo-prefixing feature is a gimmick after all. Closes: 825742
* travis: use gcc-5 instead of gcc(-4.9)David Kalnischkies2016-05-281-1/+3
| | | | | | | | | | | | | | | | | The std::put_time and std::get_time introduced in 9febc2b238e1e322dce1f94ecbed46d595893b52 are part of C++11, but not implemented in GCC until version 5. std::put_time could actually be worked around via using the facets put() directly, but get() isn't implemented so that doesn't really help. We require various tools from wily (which also means we can't build apt on Debian stable) already, so requiring gcc-5 is just one more instead of a big step [and an ignoreable change for changelog anyhow]. It also helps in testing what will actually be used (in terms of the c++11 std ABI) instead of the old ABI. Git-Dch: Ignore
* look into the right textdomain for apt-utils againDavid Kalnischkies2016-05-2814-25/+26
| | | | | Broken in e7e10e47476606e3b2274cf66b1e8ea74b236757 by looking always into "apt" while we ship some tools in "apt-utils"…
* use std::locale::global instead of setlocaleDavid Kalnischkies2016-05-2821-78/+27
| | | | | | We use a wild mixture of C and C++ ways of generating output, so having a consistent world-view in both styles sounds like a good idea and should help in preventing regressions.
* use de-localed std::put_time instead rolling our ownDavid Kalnischkies2016-05-281-9/+5
|
* avoid changing the global LC_TIME for Release writingDavid Kalnischkies2016-05-281-17/+12
| | | | | Using C++ here avoids calling setlocale here which never really was that ideal, but needed to avoid locale specific weekday/month names.
* accept only the expected UTC timezones in date parsingDavid Kalnischkies2016-05-284-24/+107
| | | | | | | | | | | | | | | | | | HTTP/1.1 hardcodes GMT (RFC 7231 §7.1.1.1) and what is good enough for the internet must be good enough for us™ as we reuse the implementation internally to parse (most) dates we encounter in various places like the Release files with their Date and Valid-Until header fields. Implementing a fully timezone aware parser just feels too hard for no effective benefit as it would take 5+ years (= until LTS's are out of fashion) until a repository could use non-UTC dates and expect it to work. Not counting non-apt implementations which might or might not only want to encounter UTC here as well. As a bonus, this eliminates the use of an instance of setlocale in libapt. Closes: 819697
* prevent C++ locale number formatting in text APIsDavid Kalnischkies2016-05-2715-127/+98
| | | | | | | | | | | Setting the C++ locale via std::locale::global(std::locale("")); which would otherwise default to the default C locale (aka: unaffected by setlocale) effects the formatting of numeric types in IO streams, which for output for humans is perfectly sensible, but breaks our many text interfaces used and parsed by us and others without expecting the numbers to be formatted. Closes: #825396
* fix and document on the fly compressor configDavid Kalnischkies2016-05-277-56/+102
| | | | | | | libapt allows to configure compressors to be used by its system via configuration implemented in 03bef78461c6f443187b60799402624326843396, but that was never really documented and also only partly working, which also explains why the tests weren't using it…
* use *.docs files instead of hardcoding in debian/rulesDavid Kalnischkies2016-05-255-15/+17
| | | | Git-Dch: Ignore
* remove semi-support for different build-dirsDavid Kalnischkies2016-05-251-16/+2
| | | | | | | | | | | The debian/rules file tries to guess in which directory it is supposed to be building, but that guess is always ./build – if it wasn't it would fail later as not all rules take alternatives into acount. So, as this is clearly not used lets remove this complexity instead of fixing it up. Git-Dch: Ignore
* override lintian on doxygens embedded-javascript-libraryDavid Kalnischkies2016-05-243-2/+6
| | | | | | | The embedding is done completely automatic by doxygen and documented to be that way for reasons: /usr/share/doc/doxygen/README.jquery As we can't do anything about it, it is pointless to keep the warning.
* use https instead of git for Vcs-GitDavid Kalnischkies2016-05-241-1/+1
| | | | | Reported-By: lintian: vcs-field-uses-insecure-uri Git-Dch: Ignore
* fix two typos in untranslated errors of libapt-pkgDavid Kalnischkies2016-05-242-4/+4
| | | | | Reported-By: lintian: spelling-error-in-binary Git-Dch: Ignore
* fix two typos in apt.conf & apt-cache manpageDavid Kalnischkies2016-05-2412-33/+33
| | | | | Reported-By: lintian: spelling-error-in-manpage Git-Dch: Ignore
* remove duplicated 'the' from guides doc-base abstractDavid Kalnischkies2016-05-241-1/+1
| | | | | Reported-By: lintian: spelling-error-in-doc-base-abstract-field Git-Dch: Ignore
* no-change bump of Standards-Version to 3.9.8David Kalnischkies2016-05-241-1/+1
| | | | We don't have no menu file.
* update symbols fileDavid Kalnischkies2016-05-201-1/+14
|
* don't try to get acquire lock in simulation modeDavid Kalnischkies2016-05-201-0/+2
| | | | | | | | | | | The code moving in eb1f04dda07c2b69549ad9fd793cca0e91841b3e moved the acquire stuff above the simulation exit, so before getting locks (and creating/chmod directories) we should be checking if we should actually really do it… [ignore as bugfix of an unreleased commit] Git-Dch: Ignore
* refactor EDSP code into EDSP and EDSP-like partsDavid Kalnischkies2016-05-202-56/+74
| | | | | | | No real code change, just moving code around heavily to decouple the EDSP specific parts from those we can reuse for EDSP-like protocols. Git-Dch: Ignore