abuild: add safety check so we dont scan elfs outside our pkgdir
this is to catch bugs in abuild itself early
This commit is contained in:
parent
f43f6d312b
commit
0190dfaf8f
10
abuild.in
10
abuild.in
@ -1039,13 +1039,21 @@ find_scanelf_paths() {
|
|||||||
|
|
||||||
scan_shared_objects() {
|
scan_shared_objects() {
|
||||||
local name="$1" controldir="$2" datadir="$3"
|
local name="$1" controldir="$2" datadir="$3"
|
||||||
local opt=
|
local opt= i=
|
||||||
|
|
||||||
# allow spaces in paths
|
# allow spaces in paths
|
||||||
IFS=:
|
IFS=:
|
||||||
set -- $(find_scanelf_paths "$datadir")
|
set -- $(find_scanelf_paths "$datadir")
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
|
# sanity check, verify that each path is prefixed with datadir
|
||||||
|
for i; do
|
||||||
|
if [ "${i#$datadir}" = "$i" ]; then
|
||||||
|
error "Internal error in scanelf paths"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if options_has "ldpath-recursive"; then
|
if options_has "ldpath-recursive"; then
|
||||||
opt="--recursive"
|
opt="--recursive"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user