about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-04-07T14·01+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-04-07T14·01+0000
commitc815aff21b668f5fe7bbd04086a988df51281840 (patch)
tree8532d7fab1ab916c99d9034cfa2167b73726aba4 /src/libexpr/primops.cc
parent57d023a184bdc2f30cd7052c157e43ba1bca8288 (diff)
* `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'.

Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index a2f27b4dc87f..03d36638d4b4 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);