Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: using as function with group fails on centos 5.11 #315

Open
pwaterz opened this issue Jan 6, 2016 · 1 comment
Open

Bug: using as function with group fails on centos 5.11 #315

pwaterz opened this issue Jan 6, 2016 · 1 comment

Comments

@pwaterz
Copy link

pwaterz commented Jan 6, 2016

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.

@mattbrictson
Copy link
Member

There seems to be some escaping problem. If I remove the backslashes it works.

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

@leehambley leehambley changed the title using as function with group fails on centos 5.11 Bug: using as function with group fails on centos 5.11 Feb 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants