deployer icon indicating copy to clipboard operation
deployer copied to clipboard

Spaces in ssh_arguments are not respected

Open Dachande663 opened this issue 3 years ago • 2 comments

  • Deployer version: 7.0.1
  • Deployment OS: Ubuntu 22.04
host('123.123.123.123')->set('ssh_arguments', ['-o ProxyCommand="ssh [email protected]"']);

When setting an SSH argument on a host that includes a space, the connectionOptionsArray method calls explode on each argument with a space as the split character. Unfortunately, this explode doesn't respect spaces within protected whitespace e.g. between the "ssh" and "user@bastion" in the example above. This means the argument is split here, escaped again, and results in a bash error:

/bin/sh: 1: Syntax error: Unterminated quoted string

Is it possible to remove the explode, or if it's required, make sure it respects spaces within quote fences?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Dachande663 avatar Sep 07 '22 08:09 Dachande663

I see. Probably we need to refactor this part to keep old syntax and remove explode.

antonmedv avatar Sep 07 '22 09:09 antonmedv

see my comments on https://github.com/deployphp/deployer/issues/3558

alinalexandru avatar Dec 21 '23 08:12 alinalexandru