Skip to content

Commit

Permalink
scripts: hardened manifest_from_host.hs to verify lddtree is installe…
Browse files Browse the repository at this point in the history
…d on the system

Signed-off-by: Waldemar Kozaczuk <[email protected]>
  • Loading branch information
Waldemar Kozaczuk committed Jul 30, 2019
1 parent 0b411c9 commit 160aec3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/manifest_from_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ detect_elf()
{
local file_path=$1
local file_desc=$(file -L $file_path)
local elf_filter=$(echo $file_desc | grep -P 'LSB shared object|LSB executable' | wc -l)
local elf_filter=$(echo $file_desc | grep -P 'LSB shared object|LSB.*executable' | wc -l)
if [[ $elf_filter == 1 ]]; then
local shared_object_filter=$(echo $file_desc | grep -P 'LSB shared object' | wc -l)
if [[ $shared_object_filter == 1 ]]; then
Expand Down Expand Up @@ -111,6 +111,12 @@ done
shift $((OPTIND - 1))
[[ -z $1 ]] && usage 1

LDDTREE_INSTALLED=$(command -v lddtree)
if [ -z "$LDDTREE_INSTALLED" ]; then
echo "Please install lddtree which is part of pax-utils package"
exit 1
fi

NAME_OR_PATH=$1
SUBDIRECTORY_PATH=$2

Expand Down

0 comments on commit 160aec3

Please sign in to comment.