]> git.saurik.com Git - apt.git/log
apt.git
8 years agotest: use downloadfile instead of apthelper download-file
Julian Andres Klode [Tue, 17 Jan 2017 15:31:30 +0000 (16:31 +0100)] 
test: use downloadfile instead of apthelper download-file

This prevents CI failures from happening in 1.3 and 1.2 and
might actually be more complete.

Gbp-Dch: ignore
(cherry picked from commit 803dabde5a4345ce83b3d2ffbd475786db9769d9)
(cherry picked from commit f55bd828265ff1577533393681dcb82536d402cf)

8 years agohttps: Quote path in URL before passing it to curl
Julian Andres Klode [Thu, 29 Dec 2016 13:16:07 +0000 (14:16 +0100)] 
https: Quote path in URL before passing it to curl

Curl requires URLs to be urlencoded. We are however giving it
undecoded URLs. This causes it go completely nuts if there is
a space in the URI, producing requests like:

    GET /a file HTTP/1.1

which the servers then interpret as a GET request for "/a" with
HTTP version "file" or some other non-sense.

This works around the issue by encoding the path component of
the URL. I'm not sure if we should encode other parts of the URL
as well, this one seems to do the trick for the actual issue at
hand.

A more correct fix is to avoid the dequoting and (re-)quoting
of URLs when a redirect occurs / a new request is sent. That's
been on the radar for probably a year or two now, but nobody
bothered implementing that yet.

LP: #1651923
(cherry picked from commit 994515e689dcc5f963f5fed58284831750a5da03)
(cherry picked from commit 438b1d78b4c33d0a97406f0a7071e3c413dc0aa3)

8 years agoRelease 1.2.18 security update 1.2.18
Julian Andres Klode [Thu, 8 Dec 2016 14:29:12 +0000 (15:29 +0100)] 
Release 1.2.18 security update

8 years agogpgv: Flush the files before checking for errors
Julian Andres Klode [Tue, 6 Dec 2016 08:35:11 +0000 (09:35 +0100)] 
gpgv: Flush the files before checking for errors

This is a follow up to the previous issue where we did not check
if getline() returned -1 due to an end of file or due to an error
like memory allocation, treating both as end of file.

Here we ensure that we also handle buffered writes correctly by
flushing the files before checking for any errors in our error
stack.

Buffered writes themselves were introduced in 1.1.9, but the
function was never called with a buffered file from inside
apt until commit 46c4043d741cb2c1d54e7f5bfaa234f1b7580f6c
which was first released with apt 1.2.10. The function is
public, though, so fixing this is a good idea anyway.

Affected: >= 1.1.9
(cherry picked from commit 6212ee84a517ed68217429022bd45c108ecf9f85)
(cherry picked from commit e115da452632a024a2885fea27a6c2c5145282b1)

8 years agoSECURITY UPDATE: gpgv: Check for errors when splitting files (CVE-2016-1252)
Julian Andres Klode [Mon, 5 Dec 2016 22:01:25 +0000 (23:01 +0100)] 
SECURITY UPDATE: gpgv: Check for errors when splitting files (CVE-2016-1252)

This fixes a security issue where signatures of the
InRelease files could be circumvented in a man-in-the-middle
attack, giving attackers the ability to serve any packages
they want to a system, in turn giving them root access.

It turns out that getline() may not only return EINVAL
as stated in the documentation - it might also return
in case of an error when allocating memory.

This fix not only adds a check that reading worked
correctly, it also implicitly checks that all writes
worked by reporting any other error that occurred inside
the loop and was logged by apt.

Affected: >= 0.9.8
Reported-By: Jann Horn <jannh@google.com>
Thanks: Jann Horn, Google Project Zero for reporting the issue
LP: #1647467
(cherry picked from commit 51be550c5c38a2e1ddfc2af50a9fab73ccf78026)
(cherry picked from commit 4ef9e0837ce139b398299431ae2294882f531d8e)

8 years agoRelease 1.2.17 1.2.17
Julian Andres Klode [Wed, 23 Nov 2016 19:16:08 +0000 (20:16 +0100)] 
Release 1.2.17

8 years agoshow apt-key warnings in apt update
David Kalnischkies [Thu, 25 Aug 2016 13:22:28 +0000 (15:22 +0200)] 
show apt-key warnings in apt update

In 105503b4b470c124bc0c271bd8a50e25ecbe9133 we got a warning implemented
for unreadable files which greatly improves the behavior of apt update
already as everything will work as long as we don't need the keys
included in these files. The behavior if they are needed is still
strange through as update will fail claiming missing keys and a manual
test (which the user will likely perform as root) will be successful.

Passing the new warning generated by apt-key through to apt is a bit
strange from an interface point of view, but basically duplicating the
warning code in multiple places doesn't feel right either. That means we
have no translation for the message through as apt-key has no i18n yet.

It also means that if the user has a bunch of sources each of them will
generate a warning for each unreadable file which could result in quite
a few duplicated warnings, but "too many" is better than none.

Closes: 834973
(cherry picked from commit 29c590951f812d9e9c4f17706e34f2c3315fb1f6)

8 years agotest-releasefile-verification: installaptold: Clean up before run
Julian Andres Klode [Tue, 22 Nov 2016 23:26:00 +0000 (00:26 +0100)] 
test-releasefile-verification: installaptold: Clean up before run

This is needed to make it possible to use installaptold multiple
times in a test case.

(originally part of commit 46e00c9062d09a642973e83a334483db1f310397)

8 years agoapt-key: warn instead of fail on unreadable keyrings
David Kalnischkies [Thu, 25 Aug 2016 10:42:36 +0000 (12:42 +0200)] 
apt-key: warn instead of fail on unreadable keyrings

apt-key has inconsistent behaviour if it can't read a keyring file:
Commands like 'list' skipped silently over such keyrings while 'verify'
failed hard resulting in apt to report cconfusing gpg errors (#834973).

As a first step we teach apt-key to be more consistent here skipping in
all commands over unreadable keyrings, but issuing a warning in the
process, which is as usual for apt commands displayed at the end of the
run.

(cherry picked from commit 105503b4b470c124bc0c271bd8a50e25ecbe9133)
(removed the buffering of warnings in aptwarnings.log, as we do not
 have a cleanup function where we can cat it)

LP: #1642386

8 years agoRelease 1.2.16 1.2.16
Julian Andres Klode [Tue, 15 Nov 2016 10:30:00 +0000 (11:30 +0100)] 
Release 1.2.16

8 years agoRelease 1.2.16 RC1
Julian Andres Klode [Mon, 14 Nov 2016 19:25:17 +0000 (20:25 +0100)] 
Release 1.2.16 RC1

8 years agoRevert "if the FileFd failed already following calls should fail, too"
Julian Andres Klode [Mon, 14 Nov 2016 15:24:25 +0000 (16:24 +0100)] 
Revert "if the FileFd failed already following calls should fail, too"

This reverts commit 1b63558a39ee1eed7eb024cd0e164d73beb165b1.

This commit caused a regression in the unit tests: The error was
propagated to Close(), where we expected it to return true.

8 years agoAdd shippable.yml for CI on Shippable
Julian Andres Klode [Mon, 29 Aug 2016 13:46:10 +0000 (15:46 +0200)] 
Add shippable.yml for CI on Shippable

This uses the current Ubuntu 16.04 for testing, but it only runs
one run, presumably as root.

(adapted from commit bb315d0513b93ef111ea69106d00188f0a4ec17a)

8 years agotravis: Pull in c++ standard library and g++ 5 from wily
Julian Andres Klode [Mon, 14 Nov 2016 13:40:31 +0000 (14:40 +0100)] 
travis: Pull in c++ standard library and g++ 5 from wily

The one in trusty does not support std::put_time(), causing the
compile to fail. This commit is specific to the 1.2 branch, as
newer branches already pull this in automatically.

Gbp-Dch: ignore

8 years agoUse C locale instead of C.UTF-8 for protocol strings
Julian Andres Klode [Tue, 23 Aug 2016 18:19:11 +0000 (20:19 +0200)] 
Use C locale instead of C.UTF-8 for protocol strings

The C.UTF-8 locale is not portable, so we need to use C, otherwise
we crash on other systems. We can use std::locale::classic() for
that, which might also be a bit cheaper than using locale("C").

(cherry picked from commit 0fb16c3e678044d6d06ba8a6199b1e96487ee0d8)

8 years agoimbue .diff/Index parsing with C.UTF-8 as well
David Kalnischkies [Sat, 25 Jun 2016 08:20:35 +0000 (10:20 +0200)] 
imbue .diff/Index parsing with C.UTF-8 as well

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.

(cherry picked from commit 1136a707b7792394ea4b1d039dda4f321fec9da4)

8 years agoprevent C++ locale number formatting in text APIs (try 3)
David Kalnischkies [Tue, 23 Aug 2016 13:11:20 +0000 (15:11 +0200)] 
prevent C++ locale number formatting in text APIs (try 3)

This time it is the formatting of floating numbers in progress
reporting with a radix charater potentially not being dot.

Followup of 7303e11ff28f920a6277c159aa46f80c007350bb. Regression of
b58e2c7c56b1416a343e81f9f80cb1f02c128e25 in so far as it exchanging
very effected with slightly less effected code.

LP: 1611010
(cherry picked from commit 0919f1df552ddf022ce4508cbf40e04eae5ef896)

8 years agoprevent C++ locale number formatting in text APIs (try 2)
David Kalnischkies [Sat, 30 Jul 2016 07:57:50 +0000 (09:57 +0200)] 
prevent C++ locale number formatting in text APIs (try 2)

Followup of b58e2c7c56b1416a343e81f9f80cb1f02c128e25.
Still a regression of sorts of 8b79c94af7f7cf2e5e5342294bc6e5a908cacabf.

Closes: 832044
(cherry picked from commit 7303e11ff28f920a6277c159aa46f80c007350bb)

8 years agoimbue datetime parsing with C.UTF-8 locale
David Kalnischkies [Sat, 25 Jun 2016 07:02:07 +0000 (09:02 +0200)] 
imbue datetime parsing with C.UTF-8 locale

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
(cherry picked from commit 3bdff17c894d0c3d0f813d358fc45d7a263f3552)

8 years agoavoid std::get_time usage to sidestep libstdc++6 bug
David Kalnischkies [Fri, 17 Jun 2016 15:56:45 +0000 (17:56 +0200)] 
avoid std::get_time usage to sidestep libstdc++6 bug

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
(cherry picked from commit 1d742e01470bba27715a8191c50adde4b39c2f19)

8 years agoaccept only the expected UTC timezones in date parsing
David Kalnischkies [Sat, 28 May 2016 09:03:35 +0000 (11:03 +0200)] 
accept only the expected UTC timezones in date parsing

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
(cherry picked from commit 9febc2b238e1e322dce1f94ecbed46d595893b52)

8 years agouse de-localed std::put_time instead rolling our own
David Kalnischkies [Sat, 28 May 2016 10:55:21 +0000 (12:55 +0200)] 
use de-localed std::put_time instead rolling our own

(cherry picked from commit eceb219c2a64f3f81421c3c6587380b6ae81a530)

8 years agoavoid changing the global LC_TIME for Release writing
David Kalnischkies [Sat, 28 May 2016 10:41:12 +0000 (12:41 +0200)] 
avoid changing the global LC_TIME for Release writing

Using C++ here avoids calling setlocale here which never really was that
ideal, but needed to avoid locale specific weekday/month names.

(cherry picked from commit e0b01a85bd8395449a88e1806ea4a4e3acdbac33)

8 years agoRelease 1.2.15 1.2.15
Julian Andres Klode [Mon, 31 Oct 2016 14:05:00 +0000 (15:05 +0100)] 
Release 1.2.15

8 years ago1.2.15 RC1
Julian Andres Klode [Wed, 5 Oct 2016 20:01:01 +0000 (22:01 +0200)] 
1.2.15 RC1

8 years agoDo not read stderr from proxy autodetection scripts
Julian Andres Klode [Sun, 2 Oct 2016 15:20:33 +0000 (17:20 +0200)] 
Do not read stderr from proxy autodetection scripts

This fixes a regression introduced in
  commit 8f858d560e3b7b475c623c4e242d1edce246025a

  don't leak FD in AutoProxyDetect command return parsing

which accidentally made the proxy autodetection code also read
the scripts output on stderr, not only on stdout when it switched
the code from popen() to Popen().

Reported-By: Tim Small <tim@seoss.co.uk>
(cherry picked from commit 0ecceb5bb9cc8727c117195945b7116aceb984fe)

8 years agoVersionHash: Do not skip too long dependency lines
Julian Andres Klode [Sun, 18 Sep 2016 11:24:35 +0000 (13:24 +0200)] 
VersionHash: Do not skip too long dependency lines

If the dependency line does not contain spaces in the repository
but does in the dpkg status file (because dpkg normalized the
dependency list), the dpkg line might be longer than the line
in the repository. If it now happens to be longer than 1024
characters, it would be skipped, causing the hashes to be
out of date.

Note that we have to bump the minor cache version again as
this changes the format slightly, and we might get mismatches
with an older src cache otherwise.

Fixes Debian/apt#23

(cherry picked from commit 708e2f1fe99e6f067292bc909f03f12c181e4798)

8 years agoabort connection on '.' target replies in SRV
David Kalnischkies [Sun, 4 Sep 2016 16:53:26 +0000 (18:53 +0200)] 
abort connection on '.' target replies in SRV

Commit 3af3ac2f5ec007badeded46a94be2bd06b9917a2 (released in 1.3~pre1)
implements proper fallback for SRV, but that works actually too good
as the RFC defines that such an SRV record should indicate that the
server doesn't provide this service and apt should respect this.

The solution is hence to fail again as requested even if that isn't what
the user (and perhaps even the server admins) wanted. At least we will
print a message now explicitly mentioning SRV to point people in the
right direction.

Reported-In: https://bugs.kali.org/view.php?id=3525
Reported-By: Raphaël Hertzog
(cherry picked from commit 99fdd8034b4a5cdb0100a33d0b3d5e26079c1695)

8 years agotry not to call memcpy with length 0 in hash calculations
David Kalnischkies [Wed, 31 Aug 2016 08:11:07 +0000 (10:11 +0200)] 
try not to call memcpy with length 0 in hash calculations

memcpy is marked as nonnull for its input, but ignores the input anyhow
if the declared length is zero. Our SHA2 implementations do this as
well, it was "just" MD5 and SHA1 missing, so we add the length check
here as well as along the callstack as it is really pointless to do all
these method calls for "nothing".

Reported-By: gcc -fsanitize=undefined
(cherry picked from commit 644478e8db56f305601c3628a74e53de048b28c8)

8 years agoBase256ToNum: Fix uninitialized value
Julian Andres Klode [Wed, 31 Aug 2016 15:18:07 +0000 (17:18 +0200)] 
Base256ToNum: Fix uninitialized value

If the inner Base256ToNum() returned false, it did not set
Num to a new value, causing it to be uninitialized, and thus
might have caused the function to exit despite a good result.

Also document why the Res = Num, if (Res != Num) magic is done.

Reported-By: valgrind
(cherry picked from commit cf7503d8a09ebce695423fdeb2402c456c18f3d8)

8 years agoTagFile: Fix off-by-one errors in comment stripping
Julian Andres Klode [Wed, 31 Aug 2016 15:01:04 +0000 (17:01 +0200)] 
TagFile: Fix off-by-one errors in comment stripping

Adding 1 to the value of d->End - current makes restLength one byte
too long: If we pass memchr(current, ..., restLength) has thus
undefined behavior.

Also, reading the value of current has undefined behavior if
current >= d->End, not only for current > d->End:

Consider a string of length 1, that is d->End = d->Current + 1.
We can only read at d->Current + 0, but d->Current + 1 is beyond
the end of the string.

This probably caused several inexplicable build failures on hurd-i386
in the past, and just now caused a build failure on Ubuntu's amd64
builder.

Reported-By: valgrind
(cherry picked from commit 923c592ceb6014b31ec751b97b3ed659fa3e88ae)

8 years agoMerge translations from 1.3~rc3
Julian Andres Klode [Wed, 31 Aug 2016 12:34:31 +0000 (14:34 +0200)] 
Merge translations from 1.3~rc3

This fixes a few fuzzy strings.

8 years agozh_CN.po: update simplified chinese translation
Zhou Mo [Wed, 31 Aug 2016 12:23:50 +0000 (14:23 +0200)] 
zh_CN.po: update simplified chinese translation

[jak@debian.org: This merges the state of 1.3_rc3]

8 years agotest/integration/test-srcrecord: Make executable
Julian Andres Klode [Wed, 31 Aug 2016 10:25:38 +0000 (12:25 +0200)] 
test/integration/test-srcrecord: Make executable

I actually tried to amend the previous commit, but apparently
I forgot to add the file mode change.

Gbp-Dch: ignore
(cherry picked from commit 832f95f4d018f18ff7b3d0381206f25b5a4373a6)

8 years agoFix segfault and out-of-bounds read in Binary fields
Julian Andres Klode [Wed, 31 Aug 2016 09:36:44 +0000 (11:36 +0200)] 
Fix segfault and out-of-bounds read in Binary fields

If a Binary field contains one or more spaces before a comma, the
code produced a segmentation fault, as it accidentally set a pointer
to 0 instead of the value of the pointer.

If the comma is at the beginning of the field, the code would
create a binStartNext that points one element before the start
of the string, which is undefined behavior.

We also need to check that we do not exit the string during the
replacement of spaces before commas: A string of the form " ,"
would normally exit the boundary of the Buffer:

binStartNext = offset 1 ','
binEnd = offset 0 ' '
isspace_ascii(*binEnd) = true => --binEnd
      => binEnd = - 1

We get rid of the problem by only allowing spaces to be eliminated
if they are not the first character of the buffer:

        binStartNext = offset 1 ','
        binEnd = offset 0       ' '
        binEnd > buffer = false, isspace_ascii(*binEnd) = true
 => exit loop
                => binEnd remains 0

(cherry picked from commit ce6cd75dc367b92f65e4fb539dd166d0f3361f8c)

8 years agodon't loop on pinning pkgs from absolute debs by regex
David Kalnischkies [Sun, 28 Aug 2016 20:56:17 +0000 (22:56 +0200)] 
don't loop on pinning pkgs from absolute debs by regex

An absolute filename for a *.deb file starts with a /. A package with
the name of the file is inserted in the cache which is provided by the
"real" package for internal reasons. The pinning code detects a regex
based wildcard by having the regex start with /. That is no problem
as a / can not be included in a package name… expect that our virtual
filename package can and does.

We fix this two ways actually: First, a regex is only being considered a
regex if it also ends with / (we don't support flags). That stops our
problem with the virtual filename packages already, but to be sure we
also do not enter the loop if matcher and package name are equal.

It has to be noted that the creation of pins for virtual packages like
the here effected filename packages is pointless as only versions can be
pinned, but checking that a package is really purely virtual is too
costly compared to just creating an unused pin.

Closes: 835818
(cherry picked from commit e950b7e2f89b5e48192cd469c963a44fff9f1450)

8 years agochangelog: Respect Dir setting for local changelog getting
Julian Andres Klode [Thu, 25 Aug 2016 12:24:49 +0000 (14:24 +0200)] 
changelog: Respect Dir setting for local changelog getting

This fixes issues with chroots, but the goal here was to get
the test suite working on systems without dpkg.

(cherry picked from commit 2ed62ba6abcad809d1898a40950f86217af73812)

8 years agoapt-inst: debfile: Pass comp. Name to ExtractTar, not Binary
Julian Andres Klode [Wed, 24 Aug 2016 13:10:08 +0000 (15:10 +0200)] 
apt-inst: debfile: Pass comp. Name to ExtractTar, not Binary

In the old days, apt-inst used to use binaries, but now it
uses the built-in support and matches using Name, and not a
Binary.

(cherry picked from commit 8a362893a18eca569f8b93c572aaf966572b9546)

8 years agoAccept --autoremove as alias for --auto-remove
Julian Andres Klode [Fri, 26 Aug 2016 14:14:13 +0000 (16:14 +0200)] 
Accept --autoremove as alias for --auto-remove

I probably missed that when I did the usability work. But better
late than never.

(cherry picked from commit 75d238ba66576c04f257e9d7c0a6995721f1441d)

8 years agoinstall-progress: Call the real ::fork() in our fork() method
Julian Andres Klode [Tue, 23 Aug 2016 11:24:54 +0000 (13:24 +0200)] 
install-progress: Call the real ::fork() in our fork() method

We basically called ourselves before, creating an endless loop.

Reported-By: clang
(cherry picked from commit d651c4cd71a43c385c3d3bcd3a9f25bf0a67f8f2)

8 years agoIgnore SIGINT and SIGQUIT for Pre-Install hooks
Julian Andres Klode [Fri, 19 Aug 2016 11:00:33 +0000 (13:00 +0200)] 
Ignore SIGINT and SIGQUIT for Pre-Install hooks

Instead of erroring out when receiving a SIGINT, let the
child deal with it - we'll error out anyway if the child
exits with an error or due to the signal. Also ignore
SIGQUIT, as system() ignores it.

This basically fixes Bug #832593, but: we are running
the hooks via sh -c. Some shells exit with a signal
error even if the command they are executing catches
the signal and exits successfully. So far, this has
been noticed on dash, which unfortunately, is our
default shell.

Example:
$ cat trap.sh
trap 'echo int' INT; sleep 10; exit 0
$ if dash -c ./trap.sh; then echo OK: $?; else echo FAIL: $?; fi
^Cint
FAIL: 130
$ if mksh -c ./trap.sh; then echo OK: $?; else echo FAIL: $?; fi
^Cint
OK: 0
$ if bash -c ./trap.sh; then echo OK: $?; else echo FAIL: $?; fi
^Cint
OK: 0

(cherry picked from commit a6ae3d3df490e7a5a1c8324ba9dc2e63972b1529)

8 years agoset the correct item FileSize in by-hash case
David Kalnischkies [Mon, 15 Aug 2016 08:39:53 +0000 (10:39 +0200)] 
set the correct item FileSize in by-hash case

In af81ab9030229b4ce6cbe28f0f0831d4896fda01 we implement by-hash as a
special compression type, which breaks this filesize setting as the code
is looking for a foobar.by-hash file then. Dealing this slightly gets
us the intended value. Note that this has no direct effect as this value
will be set in other ways, too, and could only effect progress reporting.

Gbp-Dch: Ignore
(cherry picked from commit 3084ef2292642d43e533654354a4929abe55d91b)

8 years agodon't try pipelining if server closes connections
David Kalnischkies [Fri, 12 Aug 2016 09:05:58 +0000 (11:05 +0200)] 
don't try pipelining if server closes connections

If a server closes a connection after sending us a file that tends to
mean that its a type of server who always closes the connection – it is
therefore relatively pointless to try pipelining with it even if it
isn't a problem by itself: apt is just restarting the pipeline each
time after it got served one file and the connection is closed.

The problem starts if one or more proxies are between the server and apt
and they disagree about how the connection should be as in the
bugreporters case where the responses apt gets contain both Keep-Alive
and Proxy-Connection headers (which apt both ignores) indicating a
proxy is trying to keep a connection open while the response also
contains "Connection: close" indicating the opposite which apt
understands and respects as it is required to do.

We avoid stepping into this abyss by not performing pipelining anymore
if we got a respond with the indication to close connection if the
response was otherwise a success – error messages are sent by some
servers via this method as their pages tend to be created dynamically
and hence their size isn't known a priori to them.

Closes: #832113
(cherry picked from commit 9714d522056e5256f5a2de587d88eba7cb3291c2)

8 years agohttp(s): allow empty values for header fields
David Kalnischkies [Fri, 12 Aug 2016 20:13:09 +0000 (22:13 +0200)] 
http(s): allow empty values for header fields

It seems completely pointless from a server-POV to sent empty header
fields, so most of them don't do it (simply proven by this limitation
existing since day one) – but it is technically allowed by the RFC as
the surounding whitespaces are optional and Github seems to like sending
"X-Geo-Block-List:\r\n" since recently (bug reports in other http
clients indicate July) at least sometimes as the reporter claims to have
seen it on https only even through it can happen with both.

Closes: 834048
(cherry picked from commit 148c049150cc39f2e40894c1684dc2aefea1117e)

8 years agodrop incorrect const attribute from DirectoryExists
David Kalnischkies [Fri, 12 Aug 2016 17:11:01 +0000 (19:11 +0200)] 
drop incorrect const attribute from DirectoryExists

Since its existence in 2010 DirectoryExists was always marked with this
attribute, but for no real reason. Arguably a check for the existence of
the file is not modifying global state, so theoretically this shouldn't
be a problem. It is wrong from a logical point of view through as
between two calls the directory could be created so the promise we made
to the compiler that it could remove the second call would be wrong, so
API wise it is wrong.

It's a bit mysterious that this is only observeable on ppc64el and can be
fixed by reordering code ever so slightly, but in the end its more our
fault for adding this attribute than the compilers fault for doing
something silly based on the attribute.

LP: 1473674
(cherry picked from commit 9445fa62386c80c9822e77484d30b2109aa0f2dc)

8 years agofileutl: empty file support: Avoid fstat() on -1 fd and check result
Julian Andres Klode [Fri, 12 Aug 2016 11:55:09 +0000 (13:55 +0200)] 
fileutl: empty file support: Avoid fstat() on -1 fd and check result

When checking if a file is empty, we forget to check that
fstat() actually worked.

(cherry picked from commit 15fe8e62d37bc87114c59d385bed7ceefb72886b)

8 years agoallow user@host (aka: no password) in URI parsing
David Kalnischkies [Mon, 1 Aug 2016 19:45:29 +0000 (21:45 +0200)] 
allow user@host (aka: no password) in URI parsing

If the URI had no password the username was ignored

(cherry picked from commit a1f3ac8aba0675321dd46d074af8abcbb10c19fd)

8 years agopass --force-remove-essential to dpkg only if needed
David Kalnischkies [Sun, 3 Jul 2016 11:57:25 +0000 (13:57 +0200)] 
pass --force-remove-essential to dpkg only if needed

APT (usually) knows which package is essential or not, so we can avoid
passing this force flag to dpkg unconditionally  if the user hasn't
chosen a non-default essential handling obscuring the information.

(cherry picked from commit d3930f8716f439c229cd3d11813823d847a2ecff)

8 years agogpgv: Unlink the correct temp file in error case
Julian Andres Klode [Thu, 28 Jul 2016 10:41:27 +0000 (12:41 +0200)] 
gpgv: Unlink the correct temp file in error case

Previously, when data could be created and sig not, we would unlink
sig, not data (and vice versa).

(cherry picked from commit d0d06f44ed60a3888528d834a799bae86c2978d5)

8 years agoif the FileFd failed already following calls should fail, too
David Kalnischkies [Fri, 29 Jul 2016 19:39:20 +0000 (21:39 +0200)] 
if the FileFd failed already following calls should fail, too

There is no point in trying to perform Write/Read on a FileFd which
already failed as they aren't going to work as expected, so we should
make sure that they fail early on and hard.

(cherry picked from commit 02c38073af51802c02bb104d4450e0e112d641ad)

8 years ago(error) va_list 'args' was opened but not closed by va_end()
David Kalnischkies [Wed, 27 Jul 2016 20:21:58 +0000 (22:21 +0200)] 
(error) va_list 'args' was opened but not closed by va_end()

Reported-By: cppcheck
Gbp-Dch: Ignore
(cherry picked from commit 196d590a99e309764e07c9dc23ea98897eebf53a)

8 years agorred: truncate result file before writing to it
David Kalnischkies [Wed, 27 Jul 2016 13:52:22 +0000 (15:52 +0200)] 
rred: truncate result file before writing to it

If another file in the transaction fails and hence dooms the transaction
we can end in a situation in which a -patched file (= rred writes the
result of the patching to it) remains in the partial/ directory.

The next apt call will perform the rred patching again and write its
result again to the -patched file, but instead of starting with an empty
file as intended it will override the content previously in the file
which has the same result if the new content happens to be longer than
the old content, but if it isn't parts of the old content remain in the
file which will pass verification as the new content written to it
matches the hashes and if the entire transaction passes the file will be
moved the lists/ directory where it might or might not trigger errors
depending on if the old content which remained forms a valid file
together with the new content.

This has no real security implications as no untrusted data is involved:
The old content consists of a base file which passed verification and a
bunch of patches which all passed multiple verifications as well, so the
old content isn't controllable by an attacker and the new one isn't
either (as the new content alone passes verification). So the best an
attacker can do is letting the user run into the same issue as in the
report.

Closes: #831762
(cherry picked from commit 0e071dfe205ad21d8b929b4bb8164b008dc7c474)

8 years agouse proper warning for automatic pipeline disable
David Kalnischkies [Wed, 27 Jul 2016 06:08:50 +0000 (08:08 +0200)] 
use proper warning for automatic pipeline disable

Also fixes message itself to mention the correct option name as noticed
in #832113.

(cherry picked from commit b9c20219dc17db1d29eaf297263a4b008bd1b90b)

8 years agoverify hash of input file in rred
David Kalnischkies [Mon, 25 Jul 2016 22:01:50 +0000 (00:01 +0200)] 
verify hash of input file in rred

We read the entire input file we want to patch anyhow, so we can also
calculate the hash for that file and compare it with what he had
expected it to be.

Note that this isn't really a security improvement as a) the file we
patch is trusted & b) if the input is incorrect, the result will hardly be
matching, so this is just for failing slightly earlier with a more
relevant error message (althrough, in terms of rred its ignored and
complete download attempt instead).

(cherry picked from commit 6e71ec6fcdcaa926c98fa58cd4af38e42556df15)

8 years agocall flush on the wrapped writebuffered FileFd
David Kalnischkies [Sat, 23 Jul 2016 13:24:46 +0000 (15:24 +0200)] 
call flush on the wrapped writebuffered FileFd

The flush call is a no-op in most FileFd implementations so this isn't
as critical as it might sound as the only non-trivial implementation is
in the buffered writer, which tends not be used to buffer another
buffer…

(cherry picked from commit 8ca481e8419c19b6ef9074b68cc028177a507161)

8 years agoTurkish program translation update
Mert Dirik [Fri, 22 Jul 2016 08:54:49 +0000 (10:54 +0200)] 
Turkish program translation update

Closes: 832039
(cherry picked from commit a913e64ead6ada2adae6fb5f35212187ad5acd01)

8 years agoAdd kernels with "+" in the package name to APT::NeverAutoRemove
Andrew Patterson [Wed, 6 Jul 2016 19:40:16 +0000 (13:40 -0600)] 
Add kernels with "+" in the package name to APT::NeverAutoRemove

Escape "+" in kernel package names when generating APT::NeverAutoRemove
list so it is not treated as a regular expression meta-character.

[Changed by David Kalnischkies: let test actually test the change]

Closes: #830159
(cherry picked from commit 130176bcb6ce65c98d5692196c55cc18b4c210e0)

8 years agokeep trying with next if connection to a SRV host failed
David Kalnischkies [Wed, 6 Jul 2016 12:49:39 +0000 (14:49 +0200)] 
keep trying with next if connection to a SRV host failed

Instead of only trying the first host we get via SRV, we try them all as
we are supposed to and if that isn't working we try to connect to the
host itself as if we hadn't seen any SRV records. This was already the
intend of the old code, but it failed to hide earlier problems for the
next call, which would unconditionally fail then resulting in an all
around failure to connect. With proper stacking we can also keep the
error messages of each call around (and in the order tried) so if the
entire connection fails we can report all the things we have tried while
we discard the entire stack if something works out in the end.

(cherry picked from commit 3af3ac2f5ec007badeded46a94be2bd06b9917a2)

8 years agoreport all instead of first error up the acquire chain
David Kalnischkies [Wed, 6 Jul 2016 13:10:52 +0000 (15:10 +0200)] 
report all instead of first error up the acquire chain

If we don't give a specific error to report up it is likely that all
error currently in the error stack are equally important, so reporting
just one could turn out to be confusing e.g. if name resolution failed
in a SRV record list.

(cherry picked from commit b50dfa6b2dd2d459e0c2746ac9367982b96ffac0)

8 years agodon't change owner/perms/times through file:// symlinks
David Kalnischkies [Tue, 5 Jul 2016 18:04:27 +0000 (20:04 +0200)] 
don't change owner/perms/times through file:// symlinks

If we have files in partial/ from a previous invocation or similar such
those could be symlinks created by file:// sources. The code is
expecting only real files through and happily changes owner,
modification times and permission on the file the symlink points to
which tend to be files we have no business in touching in this way.
Permissions of symlinks shouldn't be changed, changing owner is usually
pointless to, but just to be sure we pick the easy way out and use
lchown, check for symlinks before chmod/utimes.

Reported-By: Mattia Rizzolo on IRC
(cherry picked from commit 3465138575e1fd0d5892d9b6be1ae232eb873460)

8 years agouse the right key for compressor configuration dump
David Kalnischkies [Tue, 5 Jul 2016 12:08:57 +0000 (14:08 +0200)] 
use the right key for compressor configuration dump

The generated dump output is incorrect in sofar as it uses the name as
the key for this compressor, but they don't need to be equal as is the
case if you force some of the inbuilt ones to be disabled as our testing
framework does it at times.

This is hidden from changelog as nobody will actually notice while
describing it in a few words make it sound like an important change…

Git-Dch: Ignore
(cherry picked from commit 52bafeade99b700eeb4585608c5eee086b94dfa8)

8 years agoavoid 416 response teardown binding to null pointer
David Kalnischkies [Tue, 5 Jul 2016 11:07:29 +0000 (13:07 +0200)] 
avoid 416 response teardown binding to null pointer

methods/http.cc:640:13: runtime error: reference binding to null pointer
of type 'struct FileFd'

This reference is never used in the cases it has a nullptr, so the
practical difference is non-existent, but its a bug still.

Reported-By: gcc -fsanitize=undefined
(cherry picked from commit 4460551841d909d3ee9c1de00156ed3cdf8b1665)

8 years agoMake the test case executable
Julian Andres Klode [Tue, 5 Jul 2016 06:28:01 +0000 (08:28 +0200)] 
Make the test case executable

Gbp-Dch: ignore
(cherry picked from commit 2a90aa7a064047fb1c8783b31720cd345018ca4a)

8 years agoindextargets: Check that cache could be built before using it
Julian Andres Klode [Tue, 5 Jul 2016 06:21:28 +0000 (08:21 +0200)] 
indextargets: Check that cache could be built before using it

This caused a crash because the cache was a nullptr.

Closes: #829651
(cherry picked from commit 8823972649b0d3049c9c0d34b5f1d31160234fb4)

8 years agodo not treat same-version local debs as downgrade
David Kalnischkies [Fri, 1 Jul 2016 12:00:47 +0000 (14:00 +0200)] 
do not treat same-version local debs as downgrade

As the volatile sources are parsed last they were sorted behind the
dpkg/status file and hence are treated as a downgrade, which isn't
really what you want to happen as from a user POV its an upgrade.

(cherry picked from commit cb9ac09bd6a36e73c2dce1d529acde6e4d15e32d)

8 years agoreinstalling local deb file is no downgrade
David Kalnischkies [Fri, 1 Jul 2016 11:17:03 +0000 (13:17 +0200)] 
reinstalling local deb file is no downgrade

If we have a (e.g. locally built) deb file installed and do try to
install it again apt complained about this being a downgrade, but it
wasn't as it is the very same version… it was just confused into not
merging the versions together which looks like a downgrade then.

The same size assumption is usually good, but given that volatile files
are parsed last (even after the status file) the base assumption no
longer holds, but is easy to adept without actually changing anything in
practice.

(cherry picked from commit e7edb2fef8370d54a4b8e5a01266e6eda81ef84e)

8 years agoprotect only the latest same-source providers from autoremove
David Kalnischkies [Fri, 1 Jul 2016 08:06:53 +0000 (10:06 +0200)] 
protect only the latest same-source providers from autoremove

Traditionally all providers are protected providing something as apt
can't know which of them is actually really providing the functionality
for the user ensuring that we don't propose the removal of used stuff,
but that is of course also keeping stuff around which could be removed.

That can cause the collection of multiple old providers until the
provided package is itself no longer needed (e.g. out-of-tree kernel
modules). We combat this by marking providers only from the newest
source package version so that old providers built by older versions of
the same source package can be garbage collected.

(cherry picked from commit a0ed43f7323b9d7976ed0ba8d437a42e24af9eaf)

8 years agomore explicit MarkRequired algorithm code (part 2)
David Kalnischkies [Sat, 9 Apr 2016 11:30:59 +0000 (13:30 +0200)] 
more explicit MarkRequired algorithm code (part 2)

As the previous commit, this shouldn't change behavior at all, but
beside being more explicit and perhaps faster its also considerably
shorter (granted, mostly by if0-block elimination).

Gbp-Dch: Ignore
(cherry picked from commit 5a3339db48479114a0e1e11ebc8d640eb3e49933)

8 years agomore explicit MarkRequired algorithm code
David Kalnischkies [Fri, 8 Apr 2016 11:03:05 +0000 (13:03 +0200)] 
more explicit MarkRequired algorithm code

Piling everything in a single if statement always made my head wobble,
but it hasn't even a benefit as the most common case of a package which
isn't installed passes all of the old if and lands in the non-existent
else-part of the inner if. So beside a subjective cleanup of what goes
on this implementation should also be a bit faster.

No change in behavior should be present.

Gbp-Dch: Ignore
(cherry picked from commit 769e9f3ea1cbe67d3b98e6db6c956abde2384868)

8 years agofactor out Pkg/DepIterator prettyprinters into own header
David Kalnischkies [Thu, 28 Apr 2016 07:22:55 +0000 (09:22 +0200)] 
factor out Pkg/DepIterator prettyprinters into own header

The old prettyprinters have only access to the struct they pretty print,
which isn't enough usually as we want to know for a package also a bit
of state information like which version is the candidate.

We therefore need to pull the DepCache into context and hence use a
temporary struct which is printed instead of the iterator itself.

(cherry picked from commit 84573326f41dd09b914b8374548e7ee7c93d0439)

8 years agowrite auto-bits before calling dpkg & again after if needed
David Kalnischkies [Wed, 29 Jun 2016 14:10:12 +0000 (16:10 +0200)] 
write auto-bits before calling dpkg & again after if needed

Writing first means that even in the event of a power-failure the
autobit is saved for future processing instead of "forgotten" so that
the package is treated as manually installed.

In some cases we have to re-run the writing after dpkg is done through
as dpkg can let packages disappear and in such cases apt will move
autobits around (or in that case non-autobits) which we need to store.

(cherry picked from commit 309f497b7280a45e3626493318adb6d39ba5c69b)

8 years agoif reading of autobit state failed, let write fail
David Kalnischkies [Wed, 29 Jun 2016 12:57:00 +0000 (14:57 +0200)] 
if reading of autobit state failed, let write fail

If we can't read the old file we can't just move forward as that would
discard potentially discard old data (especially other fields). We let
it fail only after we are done writing the new file so a user has the
chance to look into and merge the new data (which is otherwise
discarded).

(cherry picked from commit 520931867ee2fac8415a624204414d3b62550996)

8 years agodon't do atomic overrides with failed files
David Kalnischkies [Wed, 29 Jun 2016 12:46:34 +0000 (14:46 +0200)] 
don't do atomic overrides with failed files

We deploy atomic renames for some files, but these renames also happen
if something about the file failed which isn't really the point of the
exercise…

Closes: 828908
(cherry picked from commit fc5db01bb7d1546944200d197866b0b5c378f100)

8 years agocache: Bump minor version to 6
Julian Andres Klode [Tue, 28 Jun 2016 15:54:31 +0000 (17:54 +0200)] 
cache: Bump minor version to 6

Needed for the previous change

(cherry picked from commit 33aa2752e7c7a6f0a01b191111aa35a5fe69cf20)

8 years agoFix buffer overflow in debListParser::VersionHash()
Julian Andres Klode [Tue, 28 Jun 2016 08:24:11 +0000 (10:24 +0200)] 
Fix buffer overflow in debListParser::VersionHash()

If a package file is formatted in a way that that no space
follows a deprecated "<", we would reformat it to "<=" and
increase the length of the output by 1, which can break.

Under normal circumstances with "<=" this should not be an
issue.

Closes: #828812
(cherry picked from commit b6e9756ca03ec887ef1d0bc8e38f63c29db7a365)

8 years agoclose server if parsing of header field failed
David Kalnischkies [Sat, 25 Jun 2016 10:32:11 +0000 (12:32 +0200)] 
close server if parsing of header field failed

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.

(cherry picked from commit cc0a4c82b3c132abba9b9ec35fd61bc8b45a1b80)

8 years agoUse the ConditionACPower feature of systemd in the apt-daily service
Nicolas Le Cam [Wed, 22 Jun 2016 19:39:38 +0000 (21:39 +0200)] 
Use the ConditionACPower feature of systemd in the apt-daily service

.. 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
(cherry picked from commit 51d659e7d8cdce59f910eceeee68e2c2afdb70d4)

8 years agomethods/ftp: Cope with weird PASV responses
Julian Andres Klode [Mon, 27 Jun 2016 08:54:26 +0000 (10:54 +0200)] 
methods/ftp: Cope with weird PASV responses

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
(cherry picked from commit 25a694165ae46c159e0d91bf0b27717f00dbc66e)

9 years agoRelease 1.2.14 1.2.14
Julian Andres Klode [Wed, 22 Jun 2016 13:01:11 +0000 (15:01 +0200)] 
Release 1.2.14

9 years agoensure filesize of deb is included in the hashes list
David Kalnischkies [Sat, 18 Jun 2016 14:27:04 +0000 (16:27 +0200)] 
ensure filesize of deb is included in the hashes list

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.

(cherry picked from commit 5da51e0e2da3f055306562d38103b06a23d81719)

9 years agosource: if download is skipped, don't try to unpack
David Kalnischkies [Sat, 18 Jun 2016 07:59:08 +0000 (09:59 +0200)] 
source: if download is skipped, don't try to unpack

If apt decides it can't download a file it is relatively pointless to
try to tell dpkg-source to unpack it.

(cherry picked from commit 60a0cb424e91acebc2bba0f9add220b474e432e6)

9 years agoReinstate caching of file hashes in apt-ftparchive
Dominic Benson [Mon, 20 Jun 2016 12:47:46 +0000 (13:47 +0100)] 
Reinstate caching of file hashes in apt-ftparchive

Check for cached hash entries to determine which (if any) hash types
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.

(cherry picked from commit 51018e947ab1df3ddba5d7a84ed2284d599d8a12)

Pull request Debian/apt#16

Closes: #806924
9 years agodo not error if auto-detect-proxy cmd has no output
David Kalnischkies [Mon, 20 Jun 2016 09:23:09 +0000 (11:23 +0200)] 
do not error if auto-detect-proxy cmd has no output

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
(cherry picked from commit cad1877559f3e1703c3fea4d081978e1b4bb4a0e)

9 years agoNorwegian Bokmål program translation update
Petter Reinholdtsen [Mon, 13 Jun 2016 09:48:36 +0000 (11:48 +0200)] 
Norwegian Bokmål program translation update

Closes: 827067
(cherry picked from commit 5e5607ef967dbc0dfc0f1aa24a71ed9f5dcf7200)

9 years agoRelease 1.2.13 1.2.13
Julian Andres Klode [Sat, 11 Jun 2016 15:29:24 +0000 (17:29 +0200)] 
Release 1.2.13

9 years agodon't leak FD in AutoProxyDetect command return parsing
David Kalnischkies [Thu, 9 Jun 2016 22:01:46 +0000 (00:01 +0200)] 
don't leak FD in AutoProxyDetect command return parsing

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.

(cherry picked from commit 8f858d560e3b7b475c623c4e242d1edce246025a)

9 years agodon't leak an FD in lz4 (de)compression
David Kalnischkies [Thu, 9 Jun 2016 19:06:48 +0000 (21:06 +0200)] 
don't leak an FD in lz4 (de)compression

Seen first in #826783, but as this buglog also shows leaked uncompressed
files as well we don't close it just yet.

(cherry picked from commit 6f35be91c9e86e463bca7df6eadf05412c7b732c)

9 years agodo not hang on piped input in PipedFileFdPrivate
David Kalnischkies [Thu, 9 Jun 2016 18:41:58 +0000 (20:41 +0200)] 
do not hang on piped input in PipedFileFdPrivate

This effects only compressors configured on the fly (rather then the
inbuilt ones as they use a library).

(cherry picked from commit bdc42211700ef0f6f40e4ef3f362e52d684d70fb)

9 years agoJapanese program translation update
Takuma Yamada [Sat, 4 Jun 2016 18:32:34 +0000 (20:32 +0200)] 
Japanese program translation update

Closes: 826291
(cherry picked from commit 8f7cee4410c7fdbc66af6a232c6900b3ceb48b48)

9 years agoapt-key: change to / before find to satisfy its CWD needs
David Kalnischkies [Thu, 2 Jun 2016 09:12:39 +0000 (11:12 +0200)] 
apt-key: change to / before find to satisfy its CWD needs

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
(cherry picked from commit 0cfec3ab589c6309bf284438d2148c7742cdaf10)

9 years agoprevent C++ locale number formatting in text APIs
David Kalnischkies [Fri, 27 May 2016 16:10:39 +0000 (18:10 +0200)] 
prevent C++ locale number formatting in text APIs

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
(cherry picked from commit b58e2c7c56b1416a343e81f9f80cb1f02c128e25)

9 years agoRussian program translation update
Yuri Kozlov [Thu, 19 May 2016 18:54:32 +0000 (20:54 +0200)] 
Russian program translation update

Closes: 824702
(cherry picked from commit 91be4122fb4dba065c19ea3f292b1945a94b5d99)

9 years agozh_TW.po: remove several fuzzy tags after review
Zhou Mo [Sat, 30 Apr 2016 13:24:42 +0000 (13:24 +0000)] 
zh_TW.po: remove several fuzzy tags after review

(cherry picked from commit 0264502c2ed8da69358959d6dc7beb67f422b5cf)

9 years agoProvide complete apt bash completion
Julian Andres Klode [Fri, 13 May 2016 08:06:31 +0000 (10:06 +0200)] 
Provide complete apt bash completion

This fixes Debian/apt#13 and the launchpad bug listed below,
but is far more advanced. I went through private-cmndline.cc
and looked at the supported options.

LP: #1573547
Thanks: Elias Fröhner and Svyatoslav Gryaznov for the initial work
(cherry picked from commit 5aba18968d87500232244760101ab2954c106581)

9 years agofail instead of segfault on unreadable config files
David Kalnischkies [Fri, 20 May 2016 07:37:24 +0000 (09:37 +0200)] 
fail instead of segfault on unreadable config files

The report mentions "apt list --upgradable", but there are others which
have inconsistent behavior ranging from segfaulting to doing something
with the partial (and hence incomplete) data. We had a recent report
about sources.list (#818628), this one mentions prefences, the obvious
next step is conf files… so the testcase is adapted to check for all
three in file and directory versions and run a bunch of commands each
time which should all have more or less the same behavior in such a case
(aka error out).

Closes: 824503
(cherry picked from commit fdf9eef4d96a18d0167708499c993e1174251e88)

9 years agoRelease 1.2.12 1.2.12
Julian Andres Klode [Wed, 11 May 2016 08:57:51 +0000 (10:57 +0200)] 
Release 1.2.12

9 years agodebian/gbp.conf: Set debian-branch to 1.2.y
Julian Andres Klode [Wed, 11 May 2016 08:38:17 +0000 (10:38 +0200)] 
debian/gbp.conf: Set debian-branch to 1.2.y

9 years agorespect user pinning in M-A:same version (un)screwing
David Kalnischkies [Wed, 27 Apr 2016 17:39:02 +0000 (19:39 +0200)] 
respect user pinning in M-A:same version (un)screwing

Using Pkg.CandVersion() here is wrong as its implementation will return
a candidate based just on the default policy settings ignoring user
preferences and otherwise set candidates (aka: it sidesteps the
pkgDepCache).

This causes M-A:same libraries to be detected as screwed even through
they aren't, so that they end up being kept back.

Reported-By: Felipe Sateler on IRC
9 years agoDutch program translation update
Frans Spiesschaert [Tue, 10 May 2016 21:21:46 +0000 (23:21 +0200)] 
Dutch program translation update

Closes: 823976
(cherry picked from commit 6fb0b9ed8c6e3b5af5aac14e8f57c4d0ec2cc638)

9 years agotest: fix permission issue if run as root
David Kalnischkies [Wed, 4 May 2016 08:08:16 +0000 (10:08 +0200)] 
test: fix permission issue if run as root

Always those silly mistakes. Do what I mean, not what I said…

Reported-By: Travis
Git-Dch: Ignore
(cherry picked from commit 737ce3135d332e3b6165ac1fac5c68e21ba1bdba)