From 29c590951f812d9e9c4f17706e34f2c3315fb1f6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 25 Aug 2016 15:22:28 +0200 Subject: show apt-key warnings in apt update In 105503b4b470c124bc0c271bd8a50e25ecbe9133 we got a warning implemented for unreadable files which greatly improves the behavior of apt update already as everything will work as long as we don't need the keys included in these files. The behavior if they are needed is still strange through as update will fail claiming missing keys and a manual test (which the user will likely perform as root) will be successful. Passing the new warning generated by apt-key through to apt is a bit strange from an interface point of view, but basically duplicating the warning code in multiple places doesn't feel right either. That means we have no translation for the message through as apt-key has no i18n yet. It also means that if the user has a bunch of sources each of them will generate a warning for each unreadable file which could result in quite a few duplicated warnings, but "too many" is better than none. Closes: 834973 --- methods/gpgv.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'methods') diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 2fed53a39..f2ef6b76e 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -39,6 +39,7 @@ using std::vector; #define GNUPGEXPSIG "[GNUPG:] EXPSIG" #define GNUPGREVKEYSIG "[GNUPG:] REVKEYSIG" #define GNUPGNODATA "[GNUPG:] NODATA" +#define APTKEYWARNING "[APTKEY:] WARNING" struct Digest { enum class State { @@ -238,6 +239,8 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, ValidSigners.push_back(sig); } + else if (strncmp(buffer, APTKEYWARNING, sizeof(APTKEYWARNING)-1) == 0) + Warning("%s", buffer + sizeof(APTKEYWARNING)); } fclose(pipein); free(buffer); -- cgit v1.2.3 From ad5282bb0c97fd0254b20fb71a59d0f755c3ed65 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 13:42:54 +0200 Subject: CMake: Do not use -lresolv if res_init exists in libc Gbp-Dch: ignore --- methods/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/CMakeLists.txt b/methods/CMakeLists.txt index 2417c4dc1..82ae70e7d 100644 --- a/methods/CMakeLists.txt +++ b/methods/CMakeLists.txt @@ -21,7 +21,7 @@ target_link_libraries(store apt-pkg) target_link_libraries(gpgv apt-pkg) target_link_libraries(cdrom apt-pkg) target_link_libraries(http apt-pkg) -target_link_libraries(mirror apt-pkg -lresolv) +target_link_libraries(mirror apt-pkg ${RESOLV_LIBRARIES}) target_link_libraries(https apt-pkg ${CURL_LIBRARIES}) target_link_libraries(ftp apt-pkg) target_link_libraries(rred apt-pkg) -- cgit v1.2.3 From 8265d6c8fdc2dd835d9cf2a47af13461fa421389 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 14:57:11 +0200 Subject: methods/connect.cc: Only use AI_IDN if defined Gbp-Dch: ignore --- methods/connect.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'methods') diff --git a/methods/connect.cc b/methods/connect.cc index c819c1dfb..cb2f83588 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -180,8 +180,10 @@ static bool ConnectToHostname(std::string const &Host, int const Port, memset(&Hints,0,sizeof(Hints)); Hints.ai_socktype = SOCK_STREAM; Hints.ai_flags = 0; +#ifdef AI_IDN if (_config->FindB("Acquire::Connect::IDN", true) == true) Hints.ai_flags |= AI_IDN; +#endif // see getaddrinfo(3): only return address if system has such a address configured // useful if system is ipv4 only, to not get ipv6, but that fails if the system has // no address configured: e.g. offline and trying to connect to localhost. -- cgit v1.2.3