Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Invalid escapes for Role.ensure_line #111

Closed
jbzdak opened this issue Jan 30, 2013 · 2 comments
Closed

Invalid escapes for Role.ensure_line #111

jbzdak opened this issue Jan 30, 2013 · 2 comments

Comments

@jbzdak
Copy link
Contributor

jbzdak commented Jan 30, 2013

There is a hard and important problem when doing shell escapes for Role.ensure_line, basically fabric does it's own set of escapes, that break stuff.

Line after escaping by provy:

export PATH=\${PATH}:\"/usr/local/scripts_for_students\"

Revelant excerpt from logs:

Requested: echo "export PATH=\${PATH}:\"/usr/local/scripts_for_students\"" >> /etc/profile
Executed: sudo -S -p 'sudo password:'  /bin/bash -l -c "echo \"export PATH=\\${PATH}:\\"/usr/local/scripts_for_students\\"\" >> /etc/profile"

Error I got is:

/bin/bash: -c: line 0: unexpected EOF while looking for matching `"'
/bin/bash: -c: line 1: syntax error: unexpected end of file

There is a pending bug on fabric for allowing to disable shell escapes: fabric/fabric#788, so I guess disabling shell escapes in fabric is out of question.

@diogobaeder
Copy link
Contributor

Yeah, I agree, Jacek, hard and important problem. I've poked in our ensure_line method, and we're already retrieving the whole file from the server to check if the line is already there, so I'll change this implementation and do the line insertion locally instead of remotely.

@diogobaeder
Copy link
Contributor

Fixed in master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants