summaryrefslogtreecommitdiff
path: root/methods/basehttp.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-10-21 15:44:43 +0200
committerJulian Andres Klode <jak@debian.org>2017-10-22 18:52:16 +0200
commit1a76517470ebc2dd3f96e39ebe6f3706d6dd78da (patch)
tree93b8d79678ba890d53d108c26118ed0807264367 /methods/basehttp.cc
parent404dececf913d3c09368a73ca00aa8172dbf6865 (diff)
Run Proxy-Auto-Detect script from main process
This avoids running the Proxy-Auto-Detect script inside the untrusted (well, less trusted for now) sandbox. This will allow us to restrict the http method from fork()ing or exec()ing via seccomp.
Diffstat (limited to 'methods/basehttp.cc')
-rw-r--r--methods/basehttp.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/methods/basehttp.cc b/methods/basehttp.cc
index 0eb617f89..59399c8bc 100644
--- a/methods/basehttp.cc
+++ b/methods/basehttp.cc
@@ -573,6 +573,13 @@ int BaseHttpMethod::Loop()
// Connect to the server
if (Server == 0 || Server->Comp(Queue->Uri) == false)
{
+ if (!Queue->Proxy().empty())
+ {
+ URI uri = Queue->Uri;
+ std::cerr << "Setting "
+ << "Acquire::" + uri.Access + "::proxy::" + uri.Host << " to " << Queue->Proxy() << std::endl;
+ _config->Set("Acquire::" + uri.Access + "::proxy::" + uri.Host, Queue->Proxy());
+ }
Server = CreateServerState(Queue->Uri);
setPostfixForMethodNames(::URI(Queue->Uri).Host.c_str());
AllowRedirect = ConfigFindB("AllowRedirect", true);