mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-05 19:50:11 +09:00
M *-: Use literal heredoc to prevent bash evaluation of stdin data
when the stdin of a command contains bash-evaluated characters,
execution will fail with funny errors like:
```
bash: line 2: : command not found
```
this patch prevents the bash evaluation through a quoted here-doc word.
`man 1 bash` says:
> If word is unquoted, all lines of the here-document are subjected to parameter expansion,
> command substitution, and arithmetic expansion, the character sequence \<newline> is ignored,
> and \ must be used to quote the characters \, $, and `.
Signed-off-by: Jonas Jelten <jj@sft.lol>
(cherry picked from commit beba07c576)
This commit is contained in:
1 parent
c115b36328
commit
934790e7d5
1 file changed
+1
-1
@@ -108,7 +108,7 @@ class OpenNebulaDriver < ActionManager
|
||||
@timeout)
|
||||
elsif options[:ssh_stream]
|
||||
if options[:stdin]
|
||||
cmdin = "cat << EOT | #{command}"
|
||||
cmdin = "cat << 'EOT' | #{command}"
|
||||
stdin = "#{options[:stdin]}\nEOT\n"
|
||||
else
|
||||
cmdin = command
|
||||
|
||||
Reference in new issue
Block a user