{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/12290","labels_url":"https://api.github.com/repos/ansible/ansible/issues/12290/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/12290/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/12290/events","html_url":"https://github.com/ansible/ansible/issues/12290","id":105558187,"number":12290,"title":"v2 regression: fetch/su is broken","user":{"login":"amenonsen","id":23628,"avatar_url":"https://avatars.githubusercontent.com/u/23628?v=3","gravatar_id":"","url":"https://api.github.com/users/amenonsen","html_url":"https://github.com/amenonsen","followers_url":"https://api.github.com/users/amenonsen/followers","following_url":"https://api.github.com/users/amenonsen/following{/other_user}","gists_url":"https://api.github.com/users/amenonsen/gists{/gist_id}","starred_url":"https://api.github.com/users/amenonsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amenonsen/subscriptions","organizations_url":"https://api.github.com/users/amenonsen/orgs","repos_url":"https://api.github.com/users/amenonsen/repos","events_url":"https://api.github.com/users/amenonsen/events{/privacy}","received_events_url":"https://api.github.com/users/amenonsen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible/labels/P1","name":"P1","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ansible/ansible/milestones/5","html_url":"https://github.com/ansible/ansible/milestones/v2","labels_url":"https://api.github.com/repos/ansible/ansible/milestones/5/labels","id":975800,"number":5,"title":"v2","description":null,"creator":{"login":"bcoca","id":836171,"avatar_url":"https://avatars.githubusercontent.com/u/836171?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoca","html_url":"https://github.com/bcoca","followers_url":"https://api.github.com/users/bcoca/followers","following_url":"https://api.github.com/users/bcoca/following{/other_user}","gists_url":"https://api.github.com/users/bcoca/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoca/subscriptions","organizations_url":"https://api.github.com/users/bcoca/orgs","repos_url":"https://api.github.com/users/bcoca/repos","events_url":"https://api.github.com/users/bcoca/events{/privacy}","received_events_url":"https://api.github.com/users/bcoca/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":307,"state":"open","created_at":"2015-02-11T19:43:06Z","updated_at":"2015-09-20T01:55:41Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-09-09T09:24:53Z","updated_at":"2015-09-20T12:17:44Z","closed_at":null,"body":"Using the latest unmodified devel (@e2e9319f), a task like this:\r\n\r\n```\r\n- fetch: src=/etc/motd dest=motd\r\n  su: yes\r\n```\r\n\r\nproduces this in the debug output:\r\n\r\n```\r\n<raven.toroid.org> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=\"/home/ams/.ansible/cp/ansible-ssh-%h-%p-%r\" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi\r\n-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 raven.toroid.org /bin/sh -c 'su  root -c \"/bin/sh -c '\"'\"'echo BECOME-SUCCESS-nrkohdhsakbxamjlftxhmfgphtzxevls; rc=flag;\r\n [ -r /etc/motd ] || rc=2; [ -f /etc/motd ] || rc=1; [ -d /etc/motd ] && rc=3; python -V 2>/dev/null || rc=4; [ x\"$rc\" != \"xflag\" ] && echo \"${rc}  \"/etc/motd && exit 0; (python -c '\"'\"'\"'\"'\"'\"'\"'\"'import hashlib;\r\n BLOCKSIZE = 65536; hasher = hashlib.sha1();\r\nafile = open(\"'\"'\"'\"'\"'\"'\"'\"'\"'/etc/motd'\"'\"'\"'\"'\"'\"'\"'\"'\", \"rb\")\r\nbuf = afile.read(BLOCKSIZE)\r\nwhile len(buf) > 0:\r\n        hasher.update(buf)\r\n        buf = afile.read(BLOCKSIZE)\r\nafile.close()\r\nprint(hasher.hexdigest())'\"'\"'\"'\"'\"'\"'\"'\"' 2>/dev/null) || (python -c '\"'\"'\"'\"'\"'\"'\"'\"'import sha; BLOCKSIZE = 65536; hasher = sha.sha();\r\nafile = open(\"'\"'\"'\"'\"'\"'\"'\"'\"'/etc/motd'\"'\"'\"'\"'\"'\"'\"'\"'\", \"rb\")\r\nbuf = afile.read(BLOCKSIZE)\r\nwhile len(buf) > 0:\r\n        hasher.update(buf)\r\n        buf = afile.read(BLOCKSIZE)\r\nafile.close()\r\nprint(hasher.hexdigest())'\"'\"'\"'\"'\"'\"'\"'\"' 2>/dev/null) || (echo '\"'\"'\"'\"'\"'\"'\"'\"'0  '\"'\"'\"'\"'\"'\"'\"'\"'/etc/motd)'\"'\"'\"'\r\n 24251 1441789764.96724: Handling privilege escalation password prompt.\r\n 24251 1441789764.96734: Waiting for Privilege Escalation input\r\n 24251 1441789764.97364: Read next chunks\r\n 24251 1441789764.97372: stderr chunk is: [removed, irrelevant ssh output]\r\n\r\n 24251 1441789764.97394: Waiting for Privilege Escalation input\r\n 24251 1441789764.97403: Read next chunks\r\n 24251 1441789765.33084: stderr chunk is: debug1: mux_client_request_session: master session id: 2^M\r\n\r\n 24251 1441789765.33136: Waiting for Privilege Escalation input\r\n 24251 1441789765.33157: Read next chunks\r\n 24251 1441789765.69062: stdout chunk is: /bin/sh: -c: line 0: syntax error near unexpected token `('^M\r\n/bin/sh: -c: line 0: `su  root -c \"/bin/sh -c 'echo BECOME-SUCCESS-nrkohdhsakbxamjlftxhmfgphtzxevls; rc=flag; [ -r /etc/motd ] || rc=2; [ -f /etc/motd ] || rc=1; [ -d /etc/motd ] && rc=3; python -V 2>/dev/null ||\r\nrc=4; [ x\"$rc\" != \"xflag\" ] && echo \"${rc}  \"/etc/motd && exit 0; (python -c '\"'\"'import hashlib; BLOCKSIZE = 65536; hasher = hashlib.sha1();'^M\r\n```\r\n\r\nNotice the ``/bin/sh: -c: line 0: syntax error near unexpected token `(``"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/141782123","html_url":"https://github.com/ansible/ansible/issues/12290#issuecomment-141782123","issue_url":"https://api.github.com/repos/ansible/ansible/issues/12290","id":141782123,"user":{"login":"jimi-c","id":26403,"avatar_url":"https://avatars.githubusercontent.com/u/26403?v=3","gravatar_id":"","url":"https://api.github.com/users/jimi-c","html_url":"https://github.com/jimi-c","followers_url":"https://api.github.com/users/jimi-c/followers","following_url":"https://api.github.com/users/jimi-c/following{/other_user}","gists_url":"https://api.github.com/users/jimi-c/gists{/gist_id}","starred_url":"https://api.github.com/users/jimi-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimi-c/subscriptions","organizations_url":"https://api.github.com/users/jimi-c/orgs","repos_url":"https://api.github.com/users/jimi-c/repos","events_url":"https://api.github.com/users/jimi-c/events{/privacy}","received_events_url":"https://api.github.com/users/jimi-c/received_events","type":"User","site_admin":false},"created_at":"2015-09-20T12:17:44Z","updated_at":"2015-09-20T12:17:44Z","body":"Due to the nature of this change, I would definitely like some increased testing, especially on BSD systems (which traditionally have caused us more command quoting issues)."}}