about summary refs log tree commit diff
path: root/tests/secure-drv-outputs.nix
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-07-20T12·15+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-07-20T12·15+0000
commitd2bfe1b071d0d71bb981535a53e9c5de43aaac81 (patch)
treeebf46ffb027950c453f25588204b98b7bbc58c2b /tests/secure-drv-outputs.nix
parent4bdb51e621e2690e561b7581d5670af08e7b3170 (diff)
* Added a test that make sure that users cannot register
  specially-crafted derivations that produce output paths belonging to
  other derivations.  This could be used to inject malware into the
  store.

Diffstat (limited to 'tests/secure-drv-outputs.nix')
-rw-r--r--tests/secure-drv-outputs.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/secure-drv-outputs.nix b/tests/secure-drv-outputs.nix
new file mode 100644
index 000000000000..da4012eb41c0
--- /dev/null
+++ b/tests/secure-drv-outputs.nix
@@ -0,0 +1,23 @@
+with import ./config.nix;
+
+{
+
+  good = mkDerivation {
+    name = "good";
+    builder = builtins.toFile "builder"
+      ''
+        mkdir $out
+        touch $out/good
+      '';
+  };
+
+  bad = mkDerivation {
+    name = "good";
+    builder = builtins.toFile "builder"
+      ''
+        mkdir $out
+        touch $out/bad
+      '';
+  };
+
+}