From a9916c3faa2b8c6fa288599efec65868d050b0ef Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 4 Dec 2019 13:58:38 +0100 Subject: 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. --- methods/aptmethod.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'methods') 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; } -- cgit v1.2.3