794866
From 6e823f2fcb904efccd8ae16d6aab8c1b34a09d5c Mon Sep 17 00:00:00 2001
794866
From: Kristian Rosenvold <krosenvold@apache.org>
794866
Date: Tue, 8 Oct 2013 18:21:04 +0200
794866
Subject: [PATCH] [PLXUTILS-161] Commandline shell injection problems
794866
794866
Patch by Charles Duffy, applied unmodified
794866
---
794866
 .../org/codehaus/plexus/util/cli/Commandline.java  | 38 +++++++++++---
794866
 .../plexus/util/cli/shell/BourneShell.java         | 60 +++++++---------------
794866
 .../org/codehaus/plexus/util/cli/shell/Shell.java  | 35 ++++++++++---
794866
 .../codehaus/plexus/util/cli/CommandlineTest.java  | 37 +++++++------
794866
 .../plexus/util/cli/shell/BourneShellTest.java     | 19 ++++---
794866
 5 files changed, 107 insertions(+), 82 deletions(-)
794866
794866
diff --git a/src/main/java/org/codehaus/plexus/util/cli/Commandline.java b/src/main/java/org/codehaus/plexus/util/cli/Commandline.java
794866
index 5e0d5af..7346c7e 100644
794866
--- a/src/main/java/org/codehaus/plexus/util/cli/Commandline.java
794866
+++ b/src/main/java/org/codehaus/plexus/util/cli/Commandline.java
794866
@@ -139,6 +139,8 @@ public class Commandline
794866
      * Create a new command line object.
794866
      * Shell is autodetected from operating system
794866
      *
794866
+     * Shell usage is only desirable when generating code for remote execution.
794866
+     *
794866
      * @param toProcess
794866
      */
794866
     public Commandline( String toProcess, Shell shell )
794866
@@ -167,6 +169,8 @@ public class Commandline
794866
     /**
794866
      * Create a new command line object.
794866
      * Shell is autodetected from operating system
794866
+     *
794866
+     * Shell usage is only desirable when generating code for remote execution.
794866
      */
794866
     public Commandline( Shell shell )
794866
     {
794866
@@ -174,8 +178,7 @@ public class Commandline
794866
     }
794866
 
794866
     /**
794866
-     * Create a new command line object.
794866
-     * Shell is autodetected from operating system
794866
+     * Create a new command line object, given a command following POSIX sh quoting rules
794866
      *
794866
      * @param toProcess
794866
      */
794866
@@ -203,7 +206,6 @@ public class Commandline
794866
 
794866
     /**
794866
      * Create a new command line object.
794866
-     * Shell is autodetected from operating system
794866
      */
794866
     public Commandline()
794866
     {
794866
@@ -253,7 +255,7 @@ public class Commandline
794866
         {
794866
             if ( realPos == -1 )
794866
             {
794866
-                realPos = ( getExecutable() == null ? 0 : 1 );
794866
+                realPos = ( getLiteralExecutable() == null ? 0 : 1 );
794866
                 for ( int i = 0; i < position; i++ )
794866
                 {
794866
                     Arg arg = (Arg) arguments.elementAt( i );
794866
@@ -404,6 +406,21 @@ public class Commandline
794866
         this.executable = executable;
794866
     }
794866
 
794866
+    /**
794866
+     * @return Executable to be run, as a literal string (no shell quoting/munging)
794866
+     */
794866
+    public String getLiteralExecutable()
794866
+    {
794866
+        return executable;
794866
+    }
794866
+
794866
+    /**
794866
+     * Return an executable name, quoted for shell use.
794866
+     *
794866
+     * Shell usage is only desirable when generating code for remote execution.
794866
+     *
794866
+     * @return Executable to be run, quoted for shell interpretation
794866
+     */
794866
     public String getExecutable()
794866
     {
794866
         String exec = shell.getExecutable();
794866
@@ -483,7 +500,7 @@ public class Commandline
794866
     public String[] getCommandline()
794866
     {
794866
         final String[] args = getArguments();
794866
-        String executable = getExecutable();
794866
+        String executable = getLiteralExecutable();
794866
 
794866
         if ( executable == null )
794866
         {
794866
@@ -497,6 +514,8 @@ public class Commandline
794866
 
794866
     /**
794866
      * Returns the shell, executable and all defined arguments.
794866
+     *
794866
+     * Shell usage is only desirable when generating code for remote execution.
794866
      */
794866
     public String[] getShellCommandline()
794866
     {
794866
@@ -633,7 +652,7 @@ public class Commandline
794866
         {
794866
             if ( workingDir == null )
794866
             {
794866
-                process = Runtime.getRuntime().exec( getShellCommandline(), environment );
794866
+                process = Runtime.getRuntime().exec( getCommandline(), environment, workingDir );
794866
             }
794866
             else
794866
             {
794866
@@ -648,7 +667,7 @@ public class Commandline
794866
                         + "\" does not specify a directory." );
794866
                 }
794866
 
794866
-                process = Runtime.getRuntime().exec( getShellCommandline(), environment, workingDir );
794866
+                process = Runtime.getRuntime().exec( getCommandline(), environment, workingDir );
794866
             }
794866
         }
794866
         catch ( IOException ex )
794866
@@ -669,7 +688,7 @@ public class Commandline
794866
             shell.setWorkingDirectory( workingDir );
794866
         }
794866
 
794866
-        if ( shell.getExecutable() == null )
794866
+        if ( shell.getOriginalExecutable() == null )
794866
         {
794866
             shell.setExecutable( executable );
794866
         }
794866
@@ -684,6 +703,8 @@ public class Commandline
794866
     /**
794866
      * Allows to set the shell to be used in this command line.
794866
      *
794866
+     * Shell usage is only desirable when generating code for remote execution.
794866
+     *
794866
      * @param shell
794866
      * @since 1.2
794866
      */
794866
@@ -695,6 +716,7 @@ public class Commandline
794866
     /**
794866
      * Get the shell to be used in this command line.
794866
      *
794866
+     * Shell usage is only desirable when generating code for remote execution.
794866
      * @since 1.2
794866
      */
794866
     public Shell getShell()
794866
diff --git a/src/main/java/org/codehaus/plexus/util/cli/shell/BourneShell.java b/src/main/java/org/codehaus/plexus/util/cli/shell/BourneShell.java
794866
index e4b4cde..3c07fb6 100644
794866
--- a/src/main/java/org/codehaus/plexus/util/cli/shell/BourneShell.java
794866
+++ b/src/main/java/org/codehaus/plexus/util/cli/shell/BourneShell.java
794866
@@ -17,7 +17,6 @@ package org.codehaus.plexus.util.cli.shell;
794866
  */
794866
 
794866
 import org.codehaus.plexus.util.Os;
794866
-import org.codehaus.plexus.util.StringUtils;
794866
 
794866
 import java.util.ArrayList;
794866
 import java.util.List;
794866
@@ -29,34 +28,18 @@ import java.util.List;
794866
 public class BourneShell
794866
     extends Shell
794866
 {
794866
-    private static final char[] BASH_QUOTING_TRIGGER_CHARS = {
794866
-        ' ',
794866
-        '$',
794866
-        ';',
794866
-        '&',
794866
-        '|',
794866
-        '<',
794866
-        '>',
794866
-        '*',
794866
-        '?',
794866
-        '(',
794866
-        ')',
794866
-        '[',
794866
-        ']',
794866
-        '{',
794866
-        '}',
794866
-        '`' };
794866
 
794866
     public BourneShell()
794866
     {
794866
-        this( false );
794866
+        this(false);
794866
     }
794866
 
794866
     public BourneShell( boolean isLoginShell )
794866
     {
794866
+        setUnconditionalQuoting( true );
794866
         setShellCommand( "/bin/sh" );
794866
         setArgumentQuoteDelimiter( '\'' );
794866
-        setExecutableQuoteDelimiter( '\"' );
794866
+        setExecutableQuoteDelimiter( '\'' );
794866
         setSingleQuotedArgumentEscaped( true );
794866
         setSingleQuotedExecutableEscaped( false );
794866
         setQuotedExecutableEnabled( true );
794866
@@ -76,7 +59,7 @@ public class BourneShell
794866
             return super.getExecutable();
794866
         }
794866
 
794866
-        return unifyQuotes( super.getExecutable());
794866
+        return quoteOneItem( super.getOriginalExecutable(), true );
794866
     }
794866
 
794866
     public List<String> getShellArgsList()
794866
@@ -126,46 +109,41 @@ public class BourneShell
794866
         StringBuffer sb = new StringBuffer();
794866
         sb.append( "cd " );
794866
 
794866
-        sb.append( unifyQuotes( dir ) );
794866
+        sb.append( quoteOneItem( dir, false ) );
794866
         sb.append( " && " );
794866
 
794866
         return sb.toString();
794866
     }
794866
 
794866
-    protected char[] getQuotingTriggerChars()
794866
-    {
794866
-        return BASH_QUOTING_TRIGGER_CHARS;
794866
-    }
794866
-
794866
     /**
794866
      * 

Unify quotes in a path for the Bourne Shell.

794866
      *
794866
      * 
794866
-     * BourneShell.unifyQuotes(null)                       = null
794866
-     * BourneShell.unifyQuotes("")                         = (empty)
794866
-     * BourneShell.unifyQuotes("/test/quotedpath'abc")     = /test/quotedpath\'abc
794866
-     * BourneShell.unifyQuotes("/test/quoted path'abc")    = "/test/quoted path'abc"
794866
-     * BourneShell.unifyQuotes("/test/quotedpath\"abc")    = "/test/quotedpath\"abc"
794866
-     * BourneShell.unifyQuotes("/test/quoted path\"abc")   = "/test/quoted path\"abc"
794866
-     * BourneShell.unifyQuotes("/test/quotedpath\"'abc")   = "/test/quotedpath\"'abc"
794866
-     * BourneShell.unifyQuotes("/test/quoted path\"'abc")  = "/test/quoted path\"'abc"
794866
+     * BourneShell.quoteOneItem(null)                       = null
794866
+     * BourneShell.quoteOneItem("")                         = ''
794866
+     * BourneShell.quoteOneItem("/test/quotedpath'abc")     = '/test/quotedpath'"'"'abc'
794866
+     * BourneShell.quoteOneItem("/test/quoted path'abc")    = '/test/quoted pat'"'"'habc'
794866
+     * BourneShell.quoteOneItem("/test/quotedpath\"abc")    = '/test/quotedpath"abc'
794866
+     * BourneShell.quoteOneItem("/test/quoted path\"abc")   = '/test/quoted path"abc'
794866
+     * BourneShell.quoteOneItem("/test/quotedpath\"'abc")   = '/test/quotedpath"'"'"'abc'
794866
+     * BourneShell.quoteOneItem("/test/quoted path\"'abc")  = '/test/quoted path"'"'"'abc'
794866
      * 
794866
      *
794866
      * @param path not null path.
794866
      * @return the path unified correctly for the Bourne shell.
794866
      */
794866
-    protected static String unifyQuotes( String path )
794866
+    protected String quoteOneItem( String path, boolean isExecutable )
794866
     {
794866
         if ( path == null )
794866
         {
794866
             return null;
794866
         }
794866
 
794866
-        if ( path.indexOf( " " ) == -1 && path.indexOf( "'" ) != -1 && path.indexOf( "\"" ) == -1 )
794866
-        {
794866
-            return StringUtils.escape( path );
794866
-        }
794866
+        StringBuilder sb = new StringBuilder();
794866
+        sb.append( "'" );
794866
+        sb.append( path.replace( "'", "'\"'\"'" ) );
794866
+        sb.append( "'" );
794866
 
794866
-        return StringUtils.quoteAndEscape( path, '\"', BASH_QUOTING_TRIGGER_CHARS );
794866
+        return sb.toString();
794866
     }
794866
 }
794866
diff --git a/src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java b/src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
794866
index 571b249..a42eae8 100644
794866
--- a/src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
794866
+++ b/src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
794866
@@ -48,6 +48,8 @@ public class Shell
794866
 
794866
     private boolean quotedArgumentsEnabled = true;
794866
 
794866
+    private boolean unconditionallyQuote = false;
794866
+
794866
     private String executable;
794866
 
794866
     private String workingDir;
794866
@@ -69,6 +71,16 @@ public class Shell
794866
     private String argumentEscapePattern = "\\%s";
794866
 
794866
     /**
794866
+     * Toggle unconditional quoting
794866
+     *
794866
+     * @param unconditionallyQuote
794866
+     */
794866
+    public void setUnconditionalQuoting(boolean unconditionallyQuote)
794866
+    {
794866
+        this.unconditionallyQuote = unconditionallyQuote;
794866
+    }
794866
+
794866
+    /**
794866
      * Set the command to execute the shell (eg. COMMAND.COM, /bin/bash,...)
794866
      *
794866
      * @param shellCommand
794866
@@ -129,6 +141,19 @@ public class Shell
794866
         return getRawCommandLine( executable, arguments );
794866
     }
794866
 
794866
+    protected String quoteOneItem(String inputString, boolean isExecutable)
794866
+    {
794866
+        char[] escapeChars = getEscapeChars( isSingleQuotedExecutableEscaped(), isDoubleQuotedExecutableEscaped() );
794866
+        return StringUtils.quoteAndEscape(
794866
+            inputString,
794866
+            isExecutable ? getExecutableQuoteDelimiter() : getArgumentQuoteDelimiter(),
794866
+            escapeChars,
794866
+            getQuotingTriggerChars(),
794866
+            '\\',
794866
+            unconditionallyQuote
794866
+        );
794866
+    }
794866
+
794866
     protected List<String> getRawCommandLine( String executable, String[] arguments )
794866
     {
794866
         List<String> commandLine = new ArrayList<String>();
794866
@@ -144,9 +169,7 @@ public class Shell
794866
 
794866
             if ( isQuotedExecutableEnabled() )
794866
             {
794866
-                char[] escapeChars = getEscapeChars( isSingleQuotedExecutableEscaped(), isDoubleQuotedExecutableEscaped() );
794866
-
794866
-                sb.append( StringUtils.quoteAndEscape( getExecutable(), getExecutableQuoteDelimiter(), escapeChars, getQuotingTriggerChars(), '\\', false ) );
794866
+                sb.append( quoteOneItem( getOriginalExecutable(), true ) );
794866
             }
794866
             else
794866
             {
794866
@@ -162,9 +185,7 @@ public class Shell
794866
 
794866
             if ( isQuotedArgumentsEnabled() )
794866
             {
794866
-                char[] escapeChars = getEscapeChars( isSingleQuotedArgumentEscaped(), isDoubleQuotedArgumentEscaped() );
794866
-
794866
-                sb.append( StringUtils.quoteAndEscape( arguments[i], getArgumentQuoteDelimiter(), escapeChars, getQuotingTriggerChars(), getArgumentEscapePattern(), false ) );
794866
+                sb.append( quoteOneItem( arguments[i], false ) );
794866
             }
794866
             else
794866
             {
794866
@@ -278,7 +299,7 @@ public class Shell
794866
             commandLine.addAll( getShellArgsList() );
794866
         }
794866
 
794866
-        commandLine.addAll( getCommandLine( getExecutable(), arguments ) );
794866
+        commandLine.addAll( getCommandLine( getOriginalExecutable(), arguments ) );
794866
 
794866
         return commandLine;
794866
 
794866
diff --git a/src/test/java/org/codehaus/plexus/util/cli/CommandlineTest.java b/src/test/java/org/codehaus/plexus/util/cli/CommandlineTest.java
794866
index b22814b..42bbb7f 100644
794866
--- a/src/test/java/org/codehaus/plexus/util/cli/CommandlineTest.java
794866
+++ b/src/test/java/org/codehaus/plexus/util/cli/CommandlineTest.java
794866
@@ -16,6 +16,7 @@ package org.codehaus.plexus.util.cli;
794866
  * limitations under the License.
794866
  */
794866
 
794866
+import junit.framework.TestCase;
794866
 import org.codehaus.plexus.util.IOUtil;
794866
 import org.codehaus.plexus.util.Os;
794866
 import org.codehaus.plexus.util.StringUtils;
794866
@@ -23,15 +24,7 @@ import org.codehaus.plexus.util.cli.shell.BourneShell;
794866
 import org.codehaus.plexus.util.cli.shell.CmdShell;
794866
 import org.codehaus.plexus.util.cli.shell.Shell;
794866
 
794866
-import java.io.File;
794866
-import java.io.FileWriter;
794866
-import java.io.IOException;
794866
-import java.io.InputStreamReader;
794866
-import java.io.Reader;
794866
-import java.io.StringWriter;
794866
-import java.io.Writer;
794866
-
794866
-import junit.framework.TestCase;
794866
+import java.io.*;
794866
 
794866
 public class CommandlineTest
794866
     extends TestCase
794866
@@ -252,7 +245,7 @@ public class CommandlineTest
794866
 
794866
         assertEquals( "/bin/sh", shellCommandline[0] );
794866
         assertEquals( "-c", shellCommandline[1] );
794866
-        String expectedShellCmd = "/bin/echo \'hello world\'";
794866
+        String expectedShellCmd = "'/bin/echo' 'hello world'";
794866
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
794866
         {
794866
             expectedShellCmd = "\\bin\\echo \'hello world\'";
794866
@@ -282,12 +275,12 @@ public class CommandlineTest
794866
 
794866
         assertEquals( "/bin/sh", shellCommandline[0] );
794866
         assertEquals( "-c", shellCommandline[1] );
794866
-        String expectedShellCmd = "cd \"" + root.getAbsolutePath()
794866
-                                  + "path with spaces\" && /bin/echo \'hello world\'";
794866
+        String expectedShellCmd = "cd '" + root.getAbsolutePath()
794866
+                                  + "path with spaces' && '/bin/echo' 'hello world'";
794866
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
794866
         {
794866
-            expectedShellCmd = "cd \"" + root.getAbsolutePath()
794866
-                               + "path with spaces\" && \\bin\\echo \'hello world\'";
794866
+            expectedShellCmd = "cd '" + root.getAbsolutePath()
794866
+                               + "path with spaces' && '\\bin\\echo' 'hello world'";
794866
         }
794866
         assertEquals( expectedShellCmd, shellCommandline[2] );
794866
     }
794866
@@ -311,7 +304,7 @@ public class CommandlineTest
794866
 
794866
         assertEquals( "/bin/sh", shellCommandline[0] );
794866
         assertEquals( "-c", shellCommandline[1] );
794866
-        String expectedShellCmd = "/bin/echo \'hello world\'";
794866
+        String expectedShellCmd = "'/bin/echo' ''\"'\"'hello world'\"'\"''";
794866
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
794866
         {
794866
             expectedShellCmd = "\\bin\\echo \'hello world\'";
794866
@@ -341,7 +334,7 @@ public class CommandlineTest
794866
         }
794866
         else
794866
         {
794866
-            assertEquals( "/usr/bin a b", shellCommandline[2] );
794866
+            assertEquals( "'/usr/bin' 'a' 'b'", shellCommandline[2] );
794866
         }
794866
     }
794866
 
794866
@@ -388,6 +381,18 @@ public class CommandlineTest
794866
     }
794866
 
794866
     /**
794866
+     * Test an executable with shell-expandable content in its path.
794866
+     *
794866
+     * @throws Exception
794866
+     */
794866
+    public void testPathWithShellExpansionStrings()
794866
+        throws Exception
794866
+    {
794866
+        File dir = new File( System.getProperty( "basedir" ), "target/test/dollar$test" );
794866
+        createAndCallScript( dir, "echo Quoted" );
794866
+    }
794866
+
794866
+    /**
794866
      * Test an executable with a single quotation mark \" in its path only for non Windows box.
794866
      *
794866
      * @throws Exception
794866
diff --git a/src/test/java/org/codehaus/plexus/util/cli/shell/BourneShellTest.java b/src/test/java/org/codehaus/plexus/util/cli/shell/BourneShellTest.java
794866
index 2a987ed..0e06c63 100644
794866
--- a/src/test/java/org/codehaus/plexus/util/cli/shell/BourneShellTest.java
794866
+++ b/src/test/java/org/codehaus/plexus/util/cli/shell/BourneShellTest.java
794866
@@ -16,14 +16,13 @@ package org.codehaus.plexus.util.cli.shell;
794866
  * limitations under the License.
794866
  */
794866
 
794866
+import junit.framework.TestCase;
794866
 import org.codehaus.plexus.util.StringUtils;
794866
 import org.codehaus.plexus.util.cli.Commandline;
794866
 
794866
 import java.util.Arrays;
794866
 import java.util.List;
794866
 
794866
-import junit.framework.TestCase;
794866
-
794866
 public class BourneShellTest
794866
     extends TestCase
794866
 {
794866
@@ -42,7 +41,7 @@ public class BourneShellTest
794866
 
794866
         String executable = StringUtils.join( sh.getShellCommandLine( new String[]{} ).iterator(), " " );
794866
 
794866
-        assertEquals( "/bin/sh -c cd /usr/local/bin && chmod", executable );
794866
+        assertEquals( "/bin/sh -c cd '/usr/local/bin' && 'chmod'", executable );
794866
     }
794866
 
794866
     public void testQuoteWorkingDirectoryAndExecutable_WDPathWithSingleQuotes()
794866
@@ -54,7 +53,7 @@ public class BourneShellTest
794866
 
794866
         String executable = StringUtils.join( sh.getShellCommandLine( new String[]{} ).iterator(), " " );
794866
 
794866
-        assertEquals( "/bin/sh -c cd \"/usr/local/\'something else\'\" && chmod", executable );
794866
+        assertEquals( "/bin/sh -c cd '/usr/local/'\"'\"'something else'\"'\"'' && 'chmod'", executable );
794866
     }
794866
 
794866
     public void testQuoteWorkingDirectoryAndExecutable_WDPathWithSingleQuotes_BackslashFileSep()
794866
@@ -66,7 +65,7 @@ public class BourneShellTest
794866
 
794866
         String executable = StringUtils.join( sh.getShellCommandLine( new String[]{} ).iterator(), " " );
794866
 
794866
-        assertEquals( "/bin/sh -c cd \"\\usr\\local\\\'something else\'\" && chmod", executable );
794866
+        assertEquals( "/bin/sh -c cd '\\usr\\local\\\'\"'\"'something else'\"'\"'' && 'chmod'", executable );
794866
     }
794866
 
794866
     public void testPreserveSingleQuotesOnArgument()
794866
@@ -82,7 +81,7 @@ public class BourneShellTest
794866
 
794866
         String cli = StringUtils.join( shellCommandLine.iterator(), " " );
794866
         System.out.println( cli );
794866
-        assertTrue( cli.endsWith( args[0] ) );
794866
+        assertTrue( cli.endsWith("''\"'\"'some arg with spaces'\"'\"''"));
794866
     }
794866
 
794866
     public void testAddSingleQuotesOnArgumentWithSpaces()
794866
@@ -114,7 +113,7 @@ public class BourneShellTest
794866
 
794866
         String cli = StringUtils.join( shellCommandLine.iterator(), " " );
794866
         System.out.println( cli );
794866
-        assertEquals("cd /usr/bin && chmod 'arg'\\''withquote'", shellCommandLine.get(shellCommandLine.size() - 1));
794866
+        assertEquals("cd '/usr/bin' && 'chmod' 'arg'\"'\"'withquote'", shellCommandLine.get(shellCommandLine.size() - 1));
794866
     }
794866
 
794866
     public void testArgumentsWithsemicolon()
794866
@@ -146,7 +145,7 @@ public class BourneShellTest
794866
 
794866
         assertEquals( "/bin/sh", lines[0] );
794866
         assertEquals( "-c", lines[1] );
794866
-        assertEquals( "chmod --password ';password'", lines[2] );
794866
+        assertEquals( "'chmod' '--password' ';password'", lines[2] );
794866
 
794866
         commandline = new Commandline( newShell() );
794866
         commandline.setExecutable( "chmod" );
794866
@@ -158,7 +157,7 @@ public class BourneShellTest
794866
 
794866
         assertEquals( "/bin/sh", lines[0] );
794866
         assertEquals( "-c", lines[1] );
794866
-        assertEquals( "chmod --password ';password'", lines[2] );
794866
+        assertEquals( "'chmod' '--password' ';password'", lines[2] );
794866
 
794866
         commandline = new Commandline( new CmdShell() );
794866
         commandline.getShell().setQuotedArgumentsEnabled( true );
794866
@@ -206,7 +205,7 @@ public class BourneShellTest
794866
 
794866
         assertEquals( "/bin/sh", lines[0] );
794866
         assertEquals( "-c", lines[1] );
794866
-        assertEquals( "chmod ' ' '|' '&&' '||' ';' ';;' '&' '()' '<' '<<' '>' '>>' '*' '?' '[' ']' '{' '}' '`'",
794866
+        assertEquals( "'chmod' ' ' '|' '&&' '||' ';' ';;' '&' '()' '<' '<<' '>' '>>' '*' '?' '[' ']' '{' '}' '`'",
794866
                       lines[2] );
794866
 
794866
     }
794866
-- 
794866
1.8.4.2
794866