]>
Commit | Line | Data |
---|---|---|
f165e102 MT |
1 | #!/bin/bash |
2 | ||
3 | . $(dirname ${0})/qa-include | |
4 | ||
5 | DESC="Searching for RPATHs. We don't want paths that point to the tree where \ | |
6 | the package was built (older, broken libtools would do this). \ | |
7 | Also check for null paths because the loader will search \$PWD when it \ | |
8 | finds null paths." | |
9 | ||
10 | check() { | |
11 | local failed=0 | |
12 | ||
13 | local file | |
14 | local rpath | |
15 | for file in $(find_elf_files --prefix=${BUILDROOT} ${BINARY_PATHS}); do | |
16 | if filtered ${file}; then | |
17 | continue | |
18 | fi | |
19 | ||
20 | rpath=$(file_get_rpath ${file}) | |
21 | if [ -n "${rpath}" ]; then | |
22 | if [ "${QUALITY_AGENT_RPATH_ALLOW_ORIGIN}" = "yes" ]; then | |
23 | [ "${rpath}" = '$ORIGIN' ] && continue | |
24 | fi | |
25 | if listmatch ${rpath} ${QUALITY_AGENT_WHITELIST_RPATH}; then | |
26 | continue | |
27 | fi | |
28 | log_error " File has unallowed rpath: ${file} - ${rpath}" | |
29 | failed=1 | |
30 | fi | |
31 | done | |
32 | ||
33 | return ${failed} | |
34 | } | |
35 | ||
36 | run |