diff options
Diffstat (limited to 'methods')
-rw-r--r-- | methods/connect.cc | 11 | ||||
-rw-r--r-- | methods/gpgv.cc | 15 | ||||
-rw-r--r-- | methods/rfc2553emu.cc | 2 |
3 files changed, 13 insertions, 15 deletions
diff --git a/methods/connect.cc b/methods/connect.cc index 9a092a43c..fc7a72ee9 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -17,6 +17,7 @@ #include <apt-pkg/fileutl.h> #include <apt-pkg/strutl.h> #include <apt-pkg/acquire-method.h> +#include <apt-pkg/configuration.h> #include <stdio.h> #include <errno.h> @@ -167,6 +168,13 @@ bool Connect(std::string Host,int Port,const char *Service,int DefPort,int &Fd, Hints.ai_flags = AI_ADDRCONFIG; Hints.ai_protocol = 0; + if(_config->FindB("Acquire::ForceIPv4", false) == true) + Hints.ai_family = AF_INET; + else if(_config->FindB("Acquire::ForceIPv6", false) == true) + Hints.ai_family = AF_INET6; + else + Hints.ai_family = AF_UNSPEC; + // if we couldn't resolve the host before, we don't try now if(bad_addr.find(Host) != bad_addr.end()) return _error->Error(_("Could not resolve '%s'"),Host.c_str()); @@ -197,6 +205,9 @@ bool Connect(std::string Host,int Port,const char *Service,int DefPort,int &Fd, return _error->Error(_("Temporary failure resolving '%s'"), Host.c_str()); } + if (Res == EAI_SYSTEM) + return _error->Errno("getaddrinfo", _("System error resolving '%s:%s'"), + Host.c_str(),ServStr); return _error->Error(_("Something wicked happened resolving '%s:%s' (%i - %s)"), Host.c_str(),ServStr,Res,gai_strerror(Res)); } diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 25ba0d063..3f814b9f0 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -6,6 +6,7 @@ #include <apt-pkg/fileutl.h> #include <apt-pkg/indexcopy.h> #include <apt-pkg/configuration.h> +#include <apt-pkg/gpgv.h> #include <utime.h> #include <stdio.h> @@ -70,19 +71,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, if (pid < 0) return string("Couldn't spawn new process") + strerror(errno); else if (pid == 0) - { - _error->PushToStack(); - bool const success = SigVerify::RunGPGV(outfile, file, 3, fd); - if (success == false) - { - string errmsg; - _error->PopMessage(errmsg); - _error->RevertToStack(); - return errmsg; - } - _error->RevertToStack(); - exit(111); - } + ExecGPGV(outfile, file, 3, fd); close(fd[1]); FILE *pipein = fdopen(fd[0], "r"); diff --git a/methods/rfc2553emu.cc b/methods/rfc2553emu.cc index f00e85889..372882769 100644 --- a/methods/rfc2553emu.cc +++ b/methods/rfc2553emu.cc @@ -154,11 +154,9 @@ int getaddrinfo(const char *nodename, const char *servname, /* */ void freeaddrinfo(struct addrinfo *ai) { - struct addrinfo *Tmp; while (ai != 0) { free(ai->ai_addr); - Tmp = ai; ai = ai->ai_next; free(ai); } |