From: Michael Tremer Date: Sun, 14 Feb 2010 14:25:24 +0000 (+0100) Subject: QA: Check for absolute symlinks. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ebb7b5cb3cad369eecccaf4ed31d23a791d2b00;p=ipfire-3.x.git QA: Check for absolute symlinks. --- diff --git a/tools/quality-agent.d/002-bad-symlinks b/tools/quality-agent.d/002-bad-symlinks new file mode 100755 index 000000000..f42dbde79 --- /dev/null +++ b/tools/quality-agent.d/002-bad-symlinks @@ -0,0 +1,19 @@ +#!/bin/bash + +. $(dirname ${0})/qa-include + +# Check for absolute symlinks. +# We do not allow them because they may point to any bad location. + +log "Search for absolute symlinks" + +failed=0 +for link in $(find ${BUILDROOT} -type l); do + destination=$(readlink ${link}) + if [ "${destination:0:1}" = "/" ]; then + log " absolute symlink: ${link}" + failed=1 + fi +done + +exit ${failed}