From 783782f20380e0799ca09c5d55529896fb18650e Mon Sep 17 00:00:00 2001 From: erdgeist Date: Mon, 15 May 2006 19:37:03 +0000 Subject: sh arithmetic overflows, use bc to calculate image size --- ezjail-admin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ezjail-admin') diff --git a/ezjail-admin b/ezjail-admin index 2b6dcf7..6d5cb8e 100755 --- a/ezjail-admin +++ b/ezjail-admin @@ -189,7 +189,7 @@ create) # check for a sane image size and split it up in blocks if [ "${ezjail_imagesize}" ]; then _val=`echo "${ezjail_imagesize}"|tr A-Z a-z|sed -Ees:g:km:g -es:m:kk:g -es:k:*2b:g -es:b:*128w:g -es:w:*4\ :g -e"s:(^|[^0-9])0x:\1\0X:g" -ey:x:*:` - _val=`echo $(( ${_val} ))` + _val=`echo ${_val} | bc` [ $? -eq 0 -a ${_val} -gt 0 ] || exerr "Error: The image size you specified is somehow incomprehensible (you specified ${ezjail_imagesize})." ezjail_imageblockcount=$(( ${_val} / 1048576 )) ezjail_imagerestbytes=$(( ${_val} % 1048576 )) -- cgit v1.2.3