Skip to content

Commit

Permalink
fix(nbd): shellcheck regression
Browse files Browse the repository at this point in the history
`$opts`, `$preopts` and `$nbdport` shouldn't have been quoted as they
can expand to multiple options.

Fixes: #1270
  • Loading branch information
haraldh committed Mar 31, 2021
1 parent bb69aff commit 2d83bce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules.d/95nbd/nbdroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ else
nbdport="-name $nbdport"
fi

nbd-client -check /dev/nbd0 > /dev/null \
|| nbd-client "$nbdserver" "$nbdport" /dev/nbd0 "$preopts" "$opts" || exit 1
if ! nbd-client -check /dev/nbd0 > /dev/null; then
# shellcheck disable=SC2086
nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts || exit 1
fi

# NBD doesn't emit uevents when it gets connected, so kick it
echo change > /sys/block/nbd0/uevent
Expand Down

0 comments on commit 2d83bce

Please sign in to comment.