From fad57b6aff7c4ab3f20feda99767fd78ed4f599c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 18 Jan 2017 14:19:13 -0500 Subject: [PATCH] Quote user and password in ipmitool If a value had certain characters, the command would be incorrect. For example, a password with a '#' in it would break. --- xCAT-genesis-scripts/bin/bmcsetup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index 1be072fcd..903e9585e 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -430,7 +430,7 @@ for user in $BMCUS; do TRIES=0 if [ "$CURRENTUSER" != "$user" ]; then # Change the user name, if necessary - while ! ipmitool -d $idev user set name $USERSLOT $user; do + while ! ipmitool -d $idev user set name $USERSLOT "$user"; do sleep 1 let TRIES=TRIES+1 if [ $TRIES -gt $TIMEOUT ]; then break; fi @@ -445,7 +445,7 @@ for bmcp in $BMCPW; do TRIES=0 # Set the password for the specified user - while ! ipmitool -d $idev user set password $USERSLOT $bmcp; do + while ! ipmitool -d $idev user set password $USERSLOT "$bmcp"; do sleep 1 let TRIES=TRIES+1 if [ $TRIES -gt $TIMEOUT ]; then break; fi