From c815aff21b668f5fe7bbd04086a988df51281840 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 7 Apr 2005 14:01:51 +0000 Subject: * `nix-store --add-fixed' to preload the outputs of fixed-output derivations. This is mostly to simplify the implementation of nix-prefetch-{url, svn}, which now work properly in setuid installations. * Enforce valid store names in `nix-store --add / --add-fixed'. --- src/libexpr/primops.cc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/libexpr') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index a2f27b4dc..03d36638d 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -267,17 +267,7 @@ static Expr primDerivation(EvalState & state, const ATermVector & _args) /* Check the derivation name. It shouldn't contain whitespace, but we are conservative here: we check whether only alphanumerics and some other characters appear. */ - string validChars = "+-._?="; - for (string::iterator i = drvName.begin(); i != drvName.end(); ++i) - if (!((*i >= 'A' && *i <= 'Z') || - (*i >= 'a' && *i <= 'z') || - (*i >= '0' && *i <= '9') || - validChars.find(*i) != string::npos)) - { - throw Error(format("invalid character `%1%' in derivation name `%2%'") - % *i % drvName); - } - + checkStoreName(drvName); if (isDerivation(drvName)) throw Error(format("derivation names are not allowed to end in `%1%'") % drvExtension); -- cgit v1.2.3