Bug: using as function with group fails on centos 5.11
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- bash, centos, ruby
- Domain
- devops, operating-systems
Research direction
Start with the as(user: ..., group: ...) entry point and the generated sudo/sg command shown in the report. Reproduce the issue on CentOS 5.11 with execute :ls, then trace the quoting and escaping around the nested shell command. Done means the command parses successfully and runs ls as the specified user and group.
Written by the indexing model from the issue text.
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.
- Dominant language
- Ruby
- Stars
- 1.2k
- Forks
- 257
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from capistrano/sshkit
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
capistrano/sshkit#563 · 6 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
capistrano/sshkit#562 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
capistrano/sshkit#554 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
capistrano/sshkit#543 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
capistrano/sshkit#518 · 1 comment ·
All issues in capistrano/sshkit
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
hanami/hanami-cli#449 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
resque/resque-scheduler#826 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100