diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-30 12:27:03 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-30 12:27:03 +0000 |
commit | 0190dfaf8f63b056f4f2e83ea119c276ed2df42a (patch) | |
tree | f5562b0ef35641ab9471ebd775a32c1049242b0f /abuild.in | |
parent | f43f6d312b52702ce8020477960ab0521018b745 (diff) | |
download | abuild-0190dfaf8f63b056f4f2e83ea119c276ed2df42a.tar.gz abuild-0190dfaf8f63b056f4f2e83ea119c276ed2df42a.tar.bz2 abuild-0190dfaf8f63b056f4f2e83ea119c276ed2df42a.tar.xz abuild-0190dfaf8f63b056f4f2e83ea119c276ed2df42a.zip |
abuild: add safety check so we dont scan elfs outside our pkgdir
this is to catch bugs in abuild itself early
Diffstat (limited to 'abuild.in')
-rwxr-xr-x | abuild.in | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1039,13 +1039,21 @@ find_scanelf_paths() { scan_shared_objects() { local name="$1" controldir="$2" datadir="$3" - local opt= + local opt= i= # allow spaces in paths IFS=: set -- $(find_scanelf_paths "$datadir") 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 opt="--recursive" fi |