diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-12-04 13:58:38 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2020-01-15 22:07:25 +0100 |
commit | a9916c3faa2b8c6fa288599efec65868d050b0ef (patch) | |
tree | a16aee2e340d061e7820bc0ea87f8c64b372faea /methods/aptmethod.h | |
parent | 5db3a38926aa820546c411dd9f49f57eea24cd9e (diff) |
netrc: Add warning when ignoring entries for unencrypted protocols
Commit 93f33052de84e9aeaf19c92291d043dad2665bbd restricted auth.conf
entries to only apply to https by default, but this was silent - there
was no information why http sources with auth.conf entries suddenly
started failing. Add such information, and extend test case to cover
it.
Diffstat (limited to 'methods/aptmethod.h')
-rw-r--r-- | methods/aptmethod.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/methods/aptmethod.h b/methods/aptmethod.h index 5d792ceb7..de931dd7e 100644 --- a/methods/aptmethod.h +++ b/methods/aptmethod.h @@ -525,6 +525,7 @@ class aptAuthConfMethod : public aptMethod if (uri.User.empty() == false || uri.Password.empty() == false) return true; + _error->PushToStack(); for (auto &authconf : authconfs) { if (authconf->IsOpen() == false) @@ -538,6 +539,17 @@ class aptAuthConfMethod : public aptMethod result &= MaybeAddAuth(*authconf, uri); } + if (not _error->empty()) + { + std::string message; + while (not _error->empty()) + { + _error->PopMessage(message); + Warning("%s", message.c_str()); + } + } + _error->RevertToStack(); + return result; } |