capistrano / capistrano/sshkit

Bug: using as function with group fails on centos 5.11

Open
#315 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
1.2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

When trying to use the as function on centos 5.11 I consistent get this bash error

```
DEBUG [a0994eb0] sh: -c: line 0: unexpected EOF while looking for matching `"'
DEBUG [a0994eb0] sh: -c: line 1: syntax error: unexpected end of file
```

simple test

```
on roles(:whatever) do
as(user: 'someuser', group: 'somegroup' ) do
execute :ls
end
do
```

Command that is being ran

```
sudo -u someuser -- sh -c 'sg somegroup -c \"/usr/bin/env ls\"'
```

From what I can tell it's properly escaped. It works fine when only suppling the user and not a group.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.