Browse Source

methods: read config in most to least specific order

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::<hostname> ->
https::<hostname> while it should have been the reverse as before.

Regression-In: 3006044202
Closes: 834642
tags/debian/1.3_rc2
David Kalnischkies 4 years ago
parent
commit
d1bdb73a96
2 changed files with 5 additions and 4 deletions
  1. +2
    -2
      methods/aptmethod.h
  2. +3
    -2
      test/integration/test-bug-623443-fail-on-bad-proxies

+ 2
- 2
methods/aptmethod.h View File

@@ -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;


+ 3
- 2
test/integration/test-bug-623443-fail-on-bad-proxies View File

@@ -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

Loading…
Cancel
Save