Skip to content

Commit

Permalink
build-vm: prevent command substitution: ignored null byte in input
Browse files Browse the repository at this point in the history
  • Loading branch information
bugfinder committed Apr 17, 2018
1 parent 3648d4b commit ca2c472
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build-vm
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ background_watchdog() {
WATCHDOG_TIMEOUT=300
BUILD_OPTIONS_PARSED=
while sleep 5 ; do
WATCH=`grep -a "### VM INTERACTION" "$LOGFILE" | tail -n 1`
WATCH=$(grep -a "### VM INTERACTION" "$LOGFILE" | tr '\0' a | tail -n 1)
case $WATCH in
*VM\ INTERACTION\ START*) test -n "$WATCHDOG_START" || WATCHDOG_START=`date +%s` ;;
*VM\ INTERACTION\ END*) WATCHDOG_START= ;;
Expand Down Expand Up @@ -917,7 +917,7 @@ vm_first_stage() {
vm_attach_root
if test -n "$VM_SWAP" ; then
vm_attach_swap
BUILDSTATUS=`dd if="$VM_SWAP" bs=12 count=1 2>/dev/null`
BUILDSTATUS=$(dd if="$VM_SWAP" bs=12 count=1 2>/dev/null)
case $BUILDSTATUS in
BUILDSTATUS[02])
mkdir -p $BUILD_ROOT/.build.packages
Expand Down

0 comments on commit ca2c472

Please sign in to comment.