aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/fetchers/tarball.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/fetchers/tarball.cc')
-rw-r--r--src/libstore/fetchers/tarball.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstore/fetchers/tarball.cc b/src/libstore/fetchers/tarball.cc
index 21c785ada..1302299b3 100644
--- a/src/libstore/fetchers/tarball.cc
+++ b/src/libstore/fetchers/tarball.cc
@@ -110,6 +110,11 @@ struct TarballInputScheme : InputScheme
std::unique_ptr<Input> inputFromAttrs(const Input::Attrs & attrs) override
{
if (maybeGetStrAttr(attrs, "type") != "tarball") return {};
+
+ for (auto & [name, value] : attrs)
+ if (name != "type" && name != "url" && name != "hash" && name != "narHash")
+ throw Error("unsupported tarball input attribute '%s'", name);
+
auto input = std::make_unique<TarballInput>(parseURL(getStrAttr(attrs, "url")));
if (auto hash = maybeGetStrAttr(attrs, "hash"))
// FIXME: require SRI hash.