mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-03 02:51:18 +00:00
Merge pull request #51317 from bjornfor/audit-tmpdir
audit-tmpdir hook: use abspath matching on RPATH entries
This commit is contained in:
commit
617c2a36eb
|
@ -20,13 +20,13 @@ auditTmpdir() {
|
|||
if [[ "$i" =~ .build-id ]]; then continue; fi
|
||||
|
||||
if isELF "$i"; then
|
||||
if patchelf --print-rpath "$i" | grep -q -F "$TMPDIR/"; then
|
||||
if { printf :; 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 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/"
|
||||
|
|
Loading…
Reference in a new issue