about summary refs log tree commit diff
path: root/pkgs/tools/misc/coreutils
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2018-12-22 11:42:22 +0000
committerJörg Thalheim <joerg@thalheim.io>2018-12-23 09:43:43 +0000
commit0a35c5cc8ca13ea185d9092db641da7fb1aed05c (patch)
treef52f70111896b549549cf8b8904eaf089f623b0c /pkgs/tools/misc/coreutils
parent1b146a8c6f55b23981c3817d8346f95bb3a799fe (diff)
downloadnixlib-0a35c5cc8ca13ea185d9092db641da7fb1aed05c.tar
nixlib-0a35c5cc8ca13ea185d9092db641da7fb1aed05c.tar.gz
nixlib-0a35c5cc8ca13ea185d9092db641da7fb1aed05c.tar.bz2
nixlib-0a35c5cc8ca13ea185d9092db641da7fb1aed05c.tar.lz
nixlib-0a35c5cc8ca13ea185d9092db641da7fb1aed05c.tar.xz
nixlib-0a35c5cc8ca13ea185d9092db641da7fb1aed05c.tar.zst
nixlib-0a35c5cc8ca13ea185d9092db641da7fb1aed05c.zip
coreutils: fix unprivileged sandbox build
In usernamespaces some POSIX assumptions break, which
make some coreutils fail when running with sandbox but without a nix-deamon.
With this pull request it is possible to bootstrap stdenv without root-permission,
which is quiet useful in HPC environments.
Diffstat (limited to 'pkgs/tools/misc/coreutils')
-rw-r--r--pkgs/tools/misc/coreutils/default.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 0ddfad65a7a1..70f72513795e 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -25,16 +25,27 @@ stdenv.mkDerivation rec {
 
   patches = optional stdenv.hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch;
 
-  # The test tends to fail on btrfs and maybe other unusual filesystems.
   postPatch = ''
+    # The test tends to fail on btrfs and maybe other unusual filesystems.
     sed '2i echo Skipping dd sparse test && exit 0' -i ./tests/dd/sparse.sh
     sed '2i echo Skipping cp sparse test && exit 0' -i ./tests/cp/sparse.sh
     sed '2i echo Skipping rm deep-2 test && exit 0' -i ./tests/rm/deep-2.sh
     sed '2i echo Skipping du long-from-unreadable test && exit 0' -i ./tests/du/long-from-unreadable.sh
+
+    # sandbox does not allow setgid
     sed '2i echo Skipping chmod setgid test && exit 0' -i ./tests/chmod/setgid.sh
-    sed '2i print "Skipping env -S test";  exit 0;' -i ./tests/misc/env-S.pl
     substituteInPlace ./tests/install/install-C.sh \
       --replace 'mode3=2755' 'mode3=1755'
+
+    sed '2i print "Skipping env -S test";  exit 0;' -i ./tests/misc/env-S.pl
+
+    # these tests fail in the unprivileged nix sandbox (without nix-daemon) as we break posix assumptions
+    for f in ./tests/chgrp/{basic.sh,recurse.sh,default-no-deref.sh,no-x.sh,posix-H.sh}; do
+      sed '2i echo Skipping chgrp && exit 0' -i "$f"
+    done
+    for f in gnulib-tests/{test-chown.c,test-fchownat.c,test-lchown.c}; do
+      echo "int main() { return 0; }" > "$f"
+    done
   '';
 
   outputs = [ "out" "info" ];