1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

Validate that the file exists rather than obscure 'Not an elf file' error.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Bryan Drewery 2016-01-19 22:42:10 +00:00
parent b69c69e000
commit d1db5f8fef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294355

View File

@ -29,6 +29,11 @@ while getopts "Uv" flag; do
done
shift $((OPTIND-1))
if ! [ -f "$1" ]; then
echo "No such file or directory: $1" >&2
exit 1
fi
mime=$(file -L --mime-type $1)
isbin=0
case $mime in