1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-12 08:23:48 +02:00

Wrap ssh cmd in quotes to prevent execution of &&-chained commands on local machine

This commit is contained in:
Nils Werner 2014-10-24 16:19:13 +02:00
parent 38fd589083
commit 7d9e74e950

View File

@ -81,7 +81,7 @@ func (s *SSH) Write(f *buildfile.Buildfile) {
} }
if len(s.Cmd) > 0 { if len(s.Cmd) > 0 {
sshCmd := "ssh -o StrictHostKeyChecking=no -p %s %s %s" sshCmd := "ssh -o StrictHostKeyChecking=no -p %s %s \"%s\""
f.WriteCmd(fmt.Sprintf(sshCmd, host[1], strings.SplitN(host[0], ":", 2)[0], s.Cmd)) f.WriteCmd(fmt.Sprintf(sshCmd, host[1], strings.SplitN(host[0], ":", 2)[0], s.Cmd))
} }
} }