Skip to contentSkip to conversation

master - coverity: blkdeactivate: separate format and args for printf and declare and assign separately to avoid masking return values

PATCH Peter Rajnoha 1 participant 1 message May 31, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5b3a4a95956fe467a2c5fe1cce3925e67366d4fe
Commit:        5b3a4a95956fe467a2c5fe1cce3925e67366d4fe
Parent:        02d67848eb994c19c6ff2050196585fb763c83cb
Author:        Peter Rajnoha <[email protected]>
AuthorDate:    Tue May 31 09:39:06 2016 +0200
Committer:     Peter Rajnoha <[email protected]>
CommitterDate: Tue May 31 09:39:06 2016 +0200

coverity: blkdeactivate: separate format and args for printf and declare and assign separately to avoid masking return values

---
 scripts/blkdeactivate.sh.in |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
scripts/blkdeactivate.sh.in +5 -3
index 39b0f2c..2a48b3e 100644
@@ -147,7 +147,7 @@ device_umount_one() {
 
 	if test -z "${SKIP_UMOUNT_LIST["$mnt"]}" -a "$DO_UMOUNT" -eq "1"; then
 		echo -n "  [UMOUNT]: unmounting $name ($kname) mounted on $mnt... "
-		if eval $UMOUNT $UMOUNT_OPTS "$(printf $mnt)" $OUT $ERR; then
+		if eval $UMOUNT $UMOUNT_OPTS "$(printf "%s" "$mnt")" $OUT $ERR; then
 			echo "done"
 		else
 			echo "skipping"
@@ -193,7 +193,8 @@ deactivate_holders () {
 }
 
 deactivate_dm () {
-	local name=$(printf $name)
+	local name
+	name=$(printf "%s" "$name")
 	test -b "$DEV_DIR/mapper/$name" || return 0
 	test -z ${SKIP_DEVICE_LIST["$kname"]} || return 1
 
@@ -262,7 +263,8 @@ deactivate_lvm () {
 }
 
 deactivate_md () {
-	local name=$(printf $name)
+	local name
+	name=$(printf "%s" "$name")
 	test -b "$DEV_DIR/$name" || return 0
 	test -z ${SKIP_DEVICE_LIST["$kname"]} || return 1