[2/2] policycoreutils: fixfiles: handle unexpected spaces in command
diff mbox

Message ID 20170326143551.9407-2-alan.christopher.jenkins@gmail.com
State Not Applicable
Headers show

Commit Message

Alan Jenkins March 26, 2017, 2:35 p.m. UTC
I accidently ran `fixfiles "a b"` during testing.  Let's fix this too.
Before:

   /sbin/fixfiles: line 394: [: a: binary operator expected

   Usage: ...

After:

    Usage: ...

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
---
 policycoreutils/scripts/fixfiles | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch
diff mbox

diff --git a/policycoreutils/scripts/fixfiles b/policycoreutils/scripts/fixfiles
index d3a53ba..58a364f 100755
--- a/policycoreutils/scripts/fixfiles
+++ b/policycoreutils/scripts/fixfiles
@@ -378,8 +378,8 @@  done
 shift $(( OPTIND - 1 ))
 
 # Check for the command
-command=$1
-if [ -z $command ]; then
+command="$1"
+if [ -z "$command" ]; then
     usage
 fi
 
@@ -391,17 +391,17 @@  shift
 #
 
 if [ ! -z "$RPMFILES" ]; then
-    process $command
+    process "$command"
     if [ $# -gt 0 ]; then
 	    usage
     fi
 else
     if [ -z "$1" ]; then
-	process $command
+	process "$command"
     else
 	while [ -n "$1" ]; do
 	    FILEPATH="$1"
-	    process $command
+	    process "$command"
 	    shift
 	done
     fi