summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks/audit-tmpdir.sh
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2018-11-16 22:35:56 +0100
committerGitHub <noreply@github.com>2018-11-16 22:35:56 +0100
commit551aecfa833d00bb061ff8bf64e7906b93813aa6 (patch)
tree36ce267086b2f35fb555e56d3f2af27566a28f32 /pkgs/build-support/setup-hooks/audit-tmpdir.sh
parente15bac8f76a7974ae031332ca7aeaa8f88823dd4 (diff)
downloadnixpkgs-551aecfa833d00bb061ff8bf64e7906b93813aa6.tar
nixpkgs-551aecfa833d00bb061ff8bf64e7906b93813aa6.tar.gz
nixpkgs-551aecfa833d00bb061ff8bf64e7906b93813aa6.tar.bz2
nixpkgs-551aecfa833d00bb061ff8bf64e7906b93813aa6.tar.lz
nixpkgs-551aecfa833d00bb061ff8bf64e7906b93813aa6.tar.xz
nixpkgs-551aecfa833d00bb061ff8bf64e7906b93813aa6.tar.zst
nixpkgs-551aecfa833d00bb061ff8bf64e7906b93813aa6.zip
tmpdir audit: only fail with files referenced below (#35068)
On Linux the `$TMPDIR` is `/build`. The TMPDIR audit looks for `$TMPDIR`
in the build output, which will then fail with packages like
/buildkite-agent.

This fixes the heuristic to look for `$TMPDIR/` instead.
Diffstat (limited to 'pkgs/build-support/setup-hooks/audit-tmpdir.sh')
-rw-r--r--pkgs/build-support/setup-hooks/audit-tmpdir.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkgs/build-support/setup-hooks/audit-tmpdir.sh b/pkgs/build-support/setup-hooks/audit-tmpdir.sh
index 0f515842ebc..43ea0d6caec 100644
--- a/pkgs/build-support/setup-hooks/audit-tmpdir.sh
+++ b/pkgs/build-support/setup-hooks/audit-tmpdir.sh
@@ -13,23 +13,23 @@ auditTmpdir() {
     local dir="$1"
     [ -e "$dir" ] || return 0
 
-    header "checking for references to $TMPDIR in $dir..."
+    header "checking for references to $TMPDIR/ in $dir..."
 
     local i
     while IFS= read -r -d $'\0' i; do
         if [[ "$i" =~ .build-id ]]; then continue; fi
 
         if isELF "$i"; then
-            if patchelf --print-rpath "$i" | grep -q -F "$TMPDIR"; then
-                echo "RPATH of binary $i contains a forbidden reference to $TMPDIR"
+            if patchelf --print-rpath "$i" | grep -q -F "$TMPDIR/"; then
+                echo "RPATH of binary $i contains a forbidden reference to $TMPDIR/"
                 exit 1
             fi
         fi
 
         if  isScript "$i"; then
             if [ -e "$(dirname "$i")/.$(basename "$i")-wrapped" ]; then
-                if grep -q -F "$TMPDIR" "$i"; then
-                    echo "wrapper script $i contains a forbidden reference to $TMPDIR"
+                if grep -q -F "$TMPDIR/" "$i"; then
+                    echo "wrapper script $i contains a forbidden reference to $TMPDIR/"
                     exit 1
                 fi
             fi