From d1bdb73a96d01896ec8e213a0f14abc38d19a929 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Aug 2016 21:53:05 +0200 Subject: methods: read config in most to least specific order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The implementation of the generic config fallback did the fallback in the wrong order so that the least specific option wasn't the last value picked but in fact the first oneā€¦ doh! So in the bugreports case http -> https -> http:: -> https:: while it should have been the reverse as before. Regression-In: 30060442025824c491f58887ca7369f3c572fa57 Closes: 834642 --- methods/aptmethod.h | 4 ++-- test/integration/test-bug-623443-fail-on-bad-proxies | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/methods/aptmethod.h b/methods/aptmethod.h index 38f451708..04c4fa99b 100644 --- a/methods/aptmethod.h +++ b/methods/aptmethod.h @@ -86,10 +86,10 @@ public: } std::string ConfigFind(char const * const postfix, std::string const &defValue) const APT_NONNULL(2) { - for (auto && name: methodNames) + for (auto name = methodNames.rbegin(); name != methodNames.rend(); ++name) { std::string conf; - strprintf(conf, "Acquire::%s::%s", name.c_str(), postfix); + strprintf(conf, "Acquire::%s::%s", name->c_str(), postfix); auto const value = _config->Find(conf); if (value.empty() == false) return value; diff --git a/test/integration/test-bug-623443-fail-on-bad-proxies b/test/integration/test-bug-623443-fail-on-bad-proxies index 04542e0cd..d91a3ab8b 100755 --- a/test/integration/test-bug-623443-fail-on-bad-proxies +++ b/test/integration/test-bug-623443-fail-on-bad-proxies @@ -29,5 +29,6 @@ testfailure apt update unset http_proxy testsuccess grep 'Unsupported proxy configured' rootdir/tmp/testfailure.output - - +echo 'Acquire::http::Proxy "foo://example.org"; +Acquire::https::Proxy "DIRECT";' > rootdir/etc/apt/apt.conf.d/proxy.conf +testsuccess apt update -- cgit v1.2.3