From 169bb2d60e862c19bcdf7ee30724c73c0fdf2ebe Mon Sep 17 00:00:00 2001 From: Wes Mason Date: Fri, 19 Oct 2012 23:21:13 +0100 Subject: [PATCH] Use -r option of read shell builtin to avoid escaping of backslashes on password input --- src/Composer/IO/ConsoleIO.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/IO/ConsoleIO.php b/src/Composer/IO/ConsoleIO.php index 530bea8c3..5e84e408c 100644 --- a/src/Composer/IO/ConsoleIO.php +++ b/src/Composer/IO/ConsoleIO.php @@ -173,7 +173,7 @@ class ConsoleIO implements IOInterface } if (isset($shell)) { $this->write($question, false); - $readCmd = ($shell === 'csh') ? 'set mypassword = $<' : 'read mypassword'; + $readCmd = ($shell === 'csh') ? 'set mypassword = $<' : 'read -r mypassword'; $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd); $value = rtrim(shell_exec($command)); $this->write('');