{"action":"closed","issue":{"url":"https://api.github.com/repos/fabric/fabric/issues/1582","repository_url":"https://api.github.com/repos/fabric/fabric","labels_url":"https://api.github.com/repos/fabric/fabric/issues/1582/labels{/name}","comments_url":"https://api.github.com/repos/fabric/fabric/issues/1582/comments","events_url":"https://api.github.com/repos/fabric/fabric/issues/1582/events","html_url":"https://github.com/fabric/fabric/issues/1582","id":219051757,"number":1582,"title":"Bash shellshock fix breaks environment parsing/passing","user":{"login":"MarkAhlstrom","id":20444749,"avatar_url":"https://avatars1.githubusercontent.com/u/20444749?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkAhlstrom","html_url":"https://github.com/MarkAhlstrom","followers_url":"https://api.github.com/users/MarkAhlstrom/followers","following_url":"https://api.github.com/users/MarkAhlstrom/following{/other_user}","gists_url":"https://api.github.com/users/MarkAhlstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkAhlstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkAhlstrom/subscriptions","organizations_url":"https://api.github.com/users/MarkAhlstrom/orgs","repos_url":"https://api.github.com/users/MarkAhlstrom/repos","events_url":"https://api.github.com/users/MarkAhlstrom/events{/privacy}","received_events_url":"https://api.github.com/users/MarkAhlstrom/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-04-03T20:27:29Z","updated_at":"2017-04-04T00:24:14Z","closed_at":"2017-04-04T00:24:14Z","body":"Using the SLES build of fabric in SP2, our python scripts using the fabric library.  To reproduce: \r\n\r\nOn a recent build of bash, export a function with declare -x -f NAME and then run the fabric based connection to the remote.  Passing the environment variables results in the following error:\r\n/bin/bash: -c: line 0: unexpected EOF while looking for matching ``'\r\n/bin/bash: -c: line 2: syntax error: unexpected end of file\r\n\r\nMy local patch was to add the following into the _prefix_env_vars function in operations.py just before updating the env_vars\r\n```python\r\n    # Strip bash functions to account for bash changes with regards to the shellshock bug\r\n    for key,value in env.shell_env.items():\r\n        if key.startswith('BASH_FUNC_'):\r\n            del env.shell_env[key]\r\n```\r\nThis still leaves the limitation that exported bash functions are not exported to the remote.\r\n\r\nI can submit a pull request when I get some extra time."}}
{"actor":{"display_login":"bitprophet"}}