From 0ecceb5bb9cc8727c117195945b7116aceb984fe Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 2 Oct 2016 17:20:33 +0200 Subject: Do not read stderr from proxy autodetection scripts This fixes a regression introduced in commit 8f858d560e3b7b475c623c4e242d1edce246025a don't leak FD in AutoProxyDetect command return parsing which accidentally made the proxy autodetection code also read the scripts output on stderr, not only on stdout when it switched the code from popen() to Popen(). Reported-By: Tim Small --- apt-pkg/contrib/proxy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/contrib/proxy.cc') diff --git a/apt-pkg/contrib/proxy.cc b/apt-pkg/contrib/proxy.cc index 4529cf230..62cfba032 100644 --- a/apt-pkg/contrib/proxy.cc +++ b/apt-pkg/contrib/proxy.cc @@ -48,7 +48,7 @@ bool AutoDetectProxy(URI &URL) Args.push_back(nullptr); FileFd PipeFd; pid_t Child; - if(Popen(&Args[0], PipeFd, Child, FileFd::ReadOnly) == false) + if(Popen(&Args[0], PipeFd, Child, FileFd::ReadOnly, false) == false) return _error->Error("ProxyAutoDetect command '%s' failed!", AutoDetectProxyCmd.c_str()); char buf[512]; bool const goodread = PipeFd.ReadLine(buf, sizeof(buf)) != nullptr; -- cgit v1.2.3