summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2006-05-15 19:37:03 +0000
committererdgeist <erdgeist@erdgeist.org>2006-05-15 19:37:03 +0000
commit783782f20380e0799ca09c5d55529896fb18650e (patch)
tree2b4f8f200905e5843b23203e0b104c1b19613785
parent098c7cbf696ab716c0e735c36a33b4c1de88fea5 (diff)
sh arithmetic overflows, use bc to calculate image size
-rwxr-xr-xezjail-admin2
1 files changed, 1 insertions, 1 deletions
diff --git a/ezjail-admin b/ezjail-admin
index 2b6dcf7..6d5cb8e 100755
--- a/ezjail-admin
+++ b/ezjail-admin
@@ -189,7 +189,7 @@ create)
189 # check for a sane image size and split it up in blocks 189 # check for a sane image size and split it up in blocks
190 if [ "${ezjail_imagesize}" ]; then 190 if [ "${ezjail_imagesize}" ]; then
191 _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:*:` 191 _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:*:`
192 _val=`echo $(( ${_val} ))` 192 _val=`echo ${_val} | bc`
193 [ $? -eq 0 -a ${_val} -gt 0 ] || exerr "Error: The image size you specified is somehow incomprehensible (you specified ${ezjail_imagesize})." 193 [ $? -eq 0 -a ${_val} -gt 0 ] || exerr "Error: The image size you specified is somehow incomprehensible (you specified ${ezjail_imagesize})."
194 ezjail_imageblockcount=$(( ${_val} / 1048576 )) 194 ezjail_imageblockcount=$(( ${_val} / 1048576 ))
195 ezjail_imagerestbytes=$(( ${_val} % 1048576 )) 195 ezjail_imagerestbytes=$(( ${_val} % 1048576 ))