diff -Nru apt-1.2.24/apt-pkg/aptconfiguration.cc apt-1.2.25/apt-pkg/aptconfiguration.cc --- apt-1.2.24/apt-pkg/aptconfiguration.cc 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/apt-pkg/aptconfiguration.cc 2017-09-26 14:31:00.000000000 +0000 @@ -323,7 +323,7 @@ string const arch = _config->Find("APT::Architecture"); archs = _config->FindVector("APT::Architectures"); - if (archs.empty() == true) + if (archs.empty() == true && _system != nullptr) archs = _system->ArchitecturesSupported(); if (archs.empty() == true || diff -Nru apt-1.2.24/configure apt-1.2.25/configure --- apt-1.2.24/configure 2017-06-19 12:02:55.000000000 +0000 +++ apt-1.2.25/configure 2017-09-26 14:32:05.000000000 +0000 @@ -2455,7 +2455,7 @@ PACKAGE="apt" -PACKAGE_VERSION="1.2.24" +PACKAGE_VERSION="1.2.25" PACKAGE_MAIL="APT Development Team " cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" diff -Nru apt-1.2.24/configure.ac apt-1.2.25/configure.ac --- apt-1.2.24/configure.ac 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/configure.ac 2017-09-26 14:31:00.000000000 +0000 @@ -19,7 +19,7 @@ AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) PACKAGE="apt" -PACKAGE_VERSION="1.2.24" +PACKAGE_VERSION="1.2.25" PACKAGE_MAIL="APT Development Team " AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"$PACKAGE_VERSION") diff -Nru apt-1.2.24/debian/apt-daily.service apt-1.2.25/debian/apt-daily.service --- apt-1.2.24/debian/apt-daily.service 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/debian/apt-daily.service 2017-09-26 14:31:00.000000000 +0000 @@ -2,6 +2,8 @@ Description=Daily apt download activities Documentation=man:apt(8) ConditionACPower=true +After=network-online.target +Wants=network-online.target [Service] Type=oneshot diff -Nru apt-1.2.24/debian/apt-daily.timer apt-1.2.25/debian/apt-daily.timer --- apt-1.2.24/debian/apt-daily.timer 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/debian/apt-daily.timer 2017-09-26 14:31:00.000000000 +0000 @@ -1,7 +1,5 @@ [Unit] Description=Daily apt download activities -After=network-online.target -Wants=network-online.target [Timer] OnCalendar=*-*-* 6,18:00 diff -Nru apt-1.2.24/debian/apt-daily-upgrade.service apt-1.2.25/debian/apt-daily-upgrade.service --- apt-1.2.24/debian/apt-daily-upgrade.service 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/debian/apt-daily-upgrade.service 2017-09-26 14:31:00.000000000 +0000 @@ -7,3 +7,5 @@ [Service] Type=oneshot ExecStart=/usr/lib/apt/apt.systemd.daily install +KillMode=process +TimeoutStopSec=900 diff -Nru apt-1.2.24/debian/changelog apt-1.2.25/debian/changelog --- apt-1.2.24/debian/changelog 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/debian/changelog 2017-09-26 14:31:00.000000000 +0000 @@ -1,3 +1,25 @@ +apt (1.2.25) xenial; urgency=medium + + * Microrelease covering 1.4.7 (LP: #1702326) and 1.4.8 + + [ Robert Luberda ] + * fix a "critical" typo in old changelog entry (Closes: 866358) + + [ David Kalnischkies ] + * use port from SRV record instead of initial port + * don't ask an uninit _system for supported archs (LP: #1613184) + + [ Julian Andres Klode ] + * Reset failure reason when connection was successful + * http: A response with Content-Length: 0 has no content + * apt-daily: Pull in network-online.target in service, not timer + (LP: #1716973) + + [ Balint Reczey ] + * Gracefully terminate process when stopping apt-daily-upgrade (LP: #1690980) + + -- Julian Andres Klode Tue, 26 Sep 2017 16:14:54 +0200 + apt (1.2.24) xenial; urgency=medium * Microrelease covering fixes of 1.4.6 @@ -2894,7 +2916,7 @@ -- Michael Vogt Fri, 22 Mar 2013 21:57:08 +0100 -apt (0.9.7.8) unstable; urgency=criticial +apt (0.9.7.8) unstable; urgency=critical * SECURITY UPDATE: InRelease verification bypass - CVE-2013-1051 diff -Nru apt-1.2.24/doc/apt-verbatim.ent apt-1.2.25/doc/apt-verbatim.ent --- apt-1.2.24/doc/apt-verbatim.ent 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/apt-verbatim.ent 2017-09-26 14:31:00.000000000 +0000 @@ -237,7 +237,7 @@ "> - + diff -Nru apt-1.2.24/doc/po/apt-doc.pot apt-1.2.25/doc/po/apt-doc.pot --- apt-1.2.24/doc/po/apt-doc.pot 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/po/apt-doc.pot 2017-09-26 14:31:00.000000000 +0000 @@ -5,9 +5,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: apt-doc 1.2.24\n" +"Project-Id-Version: apt-doc 1.2.25\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2017-06-19 13:59+0200\n" +"POT-Creation-Date: 2017-09-26 16:16+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff -Nru apt-1.2.24/doc/po/de.po apt-1.2.25/doc/po/de.po --- apt-1.2.24/doc/po/de.po 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/po/de.po 2017-09-26 14:31:00.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: apt-doc 1.0.8\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2017-06-19 13:59+0200\n" +"POT-Creation-Date: 2017-09-26 16:16+0200\n" "PO-Revision-Date: 2014-09-14 14:46+0200\n" "Last-Translator: Chris Leick \n" "Language-Team: German \n" diff -Nru apt-1.2.24/doc/po/es.po apt-1.2.25/doc/po/es.po --- apt-1.2.24/doc/po/es.po 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/po/es.po 2017-09-26 14:31:00.000000000 +0000 @@ -38,7 +38,7 @@ msgstr "" "Project-Id-Version: apt-doc 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2017-06-19 13:59+0200\n" +"POT-Creation-Date: 2017-09-26 16:16+0200\n" "PO-Revision-Date: 2014-07-04 01:31+0200\n" "Last-Translator: Omar Campagne \n" "Language-Team: Debian l10n Spanish \n" diff -Nru apt-1.2.24/doc/po/fr.po apt-1.2.25/doc/po/fr.po --- apt-1.2.24/doc/po/fr.po 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/po/fr.po 2017-09-26 14:31:00.000000000 +0000 @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: apt-doc 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2017-06-19 13:59+0200\n" +"POT-Creation-Date: 2017-09-26 16:16+0200\n" "PO-Revision-Date: 2014-11-15 17:26+0100\n" "Last-Translator: Jean-Pierre Giraud \n" "Language-Team: French \n" diff -Nru apt-1.2.24/doc/po/it.po apt-1.2.25/doc/po/it.po --- apt-1.2.24/doc/po/it.po 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/po/it.po 2017-09-26 14:31:00.000000000 +0000 @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: apt-doc 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2017-06-19 13:59+0200\n" +"POT-Creation-Date: 2017-09-26 16:16+0200\n" "PO-Revision-Date: 2015-12-27 21:26+0200\n" "Last-Translator: Beatrice Torracca \n" "Language-Team: Italian \n" diff -Nru apt-1.2.24/doc/po/ja.po apt-1.2.25/doc/po/ja.po --- apt-1.2.24/doc/po/ja.po 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/po/ja.po 2017-09-26 14:31:00.000000000 +0000 @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: apt-doc 1.0.6\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2017-06-19 13:59+0200\n" +"POT-Creation-Date: 2017-09-26 16:16+0200\n" "PO-Revision-Date: 2016-03-23 09:39+0900\n" "Last-Translator: Takuma Yamada \n" "Language-Team: Japanese \n" diff -Nru apt-1.2.24/doc/po/nl.po apt-1.2.25/doc/po/nl.po --- apt-1.2.24/doc/po/nl.po 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/po/nl.po 2017-09-26 14:31:00.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: apt-doc 1.1.10-nl\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2017-06-19 13:59+0200\n" +"POT-Creation-Date: 2017-09-26 16:16+0200\n" "PO-Revision-Date: 2016-02-01 16:17+0100\n" "Last-Translator: Frans Spiesschaert \n" "Language-Team: Debian Dutch l10n Team \n" diff -Nru apt-1.2.24/doc/po/pl.po apt-1.2.25/doc/po/pl.po --- apt-1.2.24/doc/po/pl.po 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/po/pl.po 2017-09-26 14:31:00.000000000 +0000 @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: apt-doc 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2017-06-19 13:59+0200\n" +"POT-Creation-Date: 2017-09-26 16:16+0200\n" "PO-Revision-Date: 2014-07-04 02:13+0200\n" "Last-Translator: Robert Luberda \n" "Language-Team: Polish \n" diff -Nru apt-1.2.24/doc/po/pt_BR.po apt-1.2.25/doc/po/pt_BR.po --- apt-1.2.24/doc/po/pt_BR.po 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/po/pt_BR.po 2017-09-26 14:31:00.000000000 +0000 @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: apt-doc 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2017-06-19 13:59+0200\n" +"POT-Creation-Date: 2017-09-26 16:16+0200\n" "PO-Revision-Date: 2004-09-20 17:02+0000\n" "Last-Translator: André Luís Lopes \n" "Language-Team: \n" diff -Nru apt-1.2.24/doc/po/pt.po apt-1.2.25/doc/po/pt.po --- apt-1.2.24/doc/po/pt.po 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/doc/po/pt.po 2017-09-26 14:31:00.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: apt-doc 1.0.7\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2017-06-19 13:59+0200\n" +"POT-Creation-Date: 2017-09-26 16:16+0200\n" "PO-Revision-Date: 2014-08-29 00:34+0100\n" "Last-Translator: Américo Monteiro \n" "Language-Team: Portuguese \n" diff -Nru apt-1.2.24/methods/connect.cc apt-1.2.25/methods/connect.cc --- apt-1.2.24/methods/connect.cc 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/methods/connect.cc 2017-09-26 14:31:00.000000000 +0000 @@ -129,7 +129,9 @@ return _error->Errno("connect",_("Could not connect to %s:%s (%s)."),Host.c_str(), Service,Name); } - + + Owner->SetFailReason(""); + return true; } /*}}}*/ @@ -290,12 +292,15 @@ size_t stackSize = 0; // try to connect in the priority order of the srv records std::string initialHost{std::move(Host)}; + auto const initialPort = Port; while(SrvRecords.empty() == false) { _error->PushToStack(); ++stackSize; // PopFromSrvRecs will also remove the server - Host = PopFromSrvRecs(SrvRecords).target; + auto Srv = PopFromSrvRecs(SrvRecords); + Host = Srv.target; + Port = Srv.port; auto const ret = ConnectToHostname(Host, Port, Service, DefPort, Fd, TimeOut, Owner); if (ret) { @@ -305,6 +310,7 @@ } } Host = std::move(initialHost); + Port = initialPort; // we have no (good) SrvRecords for this host, connect right away _error->PushToStack(); diff -Nru apt-1.2.24/methods/server.cc apt-1.2.25/methods/server.cc --- apt-1.2.24/methods/server.cc 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/methods/server.cc 2017-09-26 14:31:00.000000000 +0000 @@ -163,6 +163,9 @@ if (stringcasecmp(Tag,"Content-Length:") == 0) { + auto ContentLength = strtoull(Val.c_str(), NULL, 10); + if (ContentLength == 0) + return true; if (Encoding == Closes) Encoding = Stream; HaveContent = true; @@ -171,7 +174,7 @@ if (Result == 416) DownloadSizePtr = &JunkSize; - *DownloadSizePtr = strtoull(Val.c_str(), NULL, 10); + *DownloadSizePtr = ContentLength; if (*DownloadSizePtr >= std::numeric_limits::max()) return _error->Errno("HeaderLine", _("The HTTP server sent an invalid Content-Length header")); else if (*DownloadSizePtr == 0) diff -Nru apt-1.2.24/test/integration/test-bug-738785-switch-protocol apt-1.2.25/test/integration/test-bug-738785-switch-protocol --- apt-1.2.24/test/integration/test-bug-738785-switch-protocol 2017-06-19 12:02:43.000000000 +0000 +++ apt-1.2.25/test/integration/test-bug-738785-switch-protocol 2017-09-26 14:31:00.000000000 +0000 @@ -63,4 +63,4 @@ # check that downgrades from https to http are not allowed webserverconfig 'aptwebserver::support::http' 'true' sed -i -e "s#:${APTHTTPPORT}/redirectme#:${APTHTTPSPORT}/downgrademe#" -e 's# http:# https:#' rootdir/etc/apt/sources.list.d/* -testfailure aptget update --allow-insecure-repositories +testfailure aptget update --allow-insecure-repositories -o Acquire::https::Timeout=1 -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::https=1