From 3645b8517ffbd7c1355188fb485e966da6461f49 Mon Sep 17 00:00:00 2001 From: Erich Cordoba Date: Mon, 3 Dec 2018 11:29:28 -0600 Subject: [PATCH] Fix check for ISO file in deployment script. The checking for ISO files was made through the mime type. However this method can fail as the mime type can be set differently by the browser or tool used to download the file. An example of this behavior can be found on Fedora 28 where the file command returns application/octect-stream. The fix is to avoid using the mime type for checking and just verify that if a DOS/MBR file. Closes-Bug: 1804610 Change-Id: I69f09df66215d405720801fbcbe3d43aac668564 Signed-off-by: Erich Cordoba --- deployment/libvirt/functions.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deployment/libvirt/functions.sh b/deployment/libvirt/functions.sh index 6ddd7a3a..ac8ebc4d 100644 --- a/deployment/libvirt/functions.sh +++ b/deployment/libvirt/functions.sh @@ -10,9 +10,8 @@ usage() { iso_image_check() { local ISOIMAGE=$1 - FILETYPE=$(file --mime-type -b ${ISOIMAGE}) - if ([ "$FILETYPE" != "application/x-iso9660-image" ]); then - echo "$ISOIMAGE is not an application/x-iso9660-image type" + if ! file ${ISOIMAGE} | grep "DOS/MBR" > /dev/null; then + echo "$ISOIMAGE is not an ISO type" exit -1 fi }