diff options
author | David Kalnischkies <david@kalnischkies.de> | 2017-10-28 00:01:27 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2018-01-03 19:42:45 +0100 |
commit | 04ab37fecaf286f724bef2e0969d2b67ab5ac1b1 (patch) | |
tree | 99b25e7a854dc79b8f5398a7c34ea95109ca333e /apt-pkg/acquire-method.cc | |
parent | 57fa854e4cdb060e87ca265abd5a83364f9fa681 (diff) |
require methods to request AuxRequest capability at startup
Allowing a method to request work from other methods is a powerful
capability which could be misused or exploited, so to slightly limited
the surface let method opt-in into this capability on startup.
Diffstat (limited to 'apt-pkg/acquire-method.cc')
-rw-r--r-- | apt-pkg/acquire-method.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index 4e034b402..8934d87a0 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -76,6 +76,9 @@ pkgAcqMethod::pkgAcqMethod(const char *Ver,unsigned long Flags) if ((Flags & Removable) == Removable) try_emplace(fields, "Removable", "true"); + if ((Flags & AuxRequests) == AuxRequests) + try_emplace(fields, "AuxRequests", "true"); + SendMessage("100 Capabilities", std::move(fields)); SetNonBlock(STDIN_FILENO,true); |