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

regression: commit 8647fdc breaks become_method='su' #14116

Closed
lifanov opened this issue Jan 25, 2016 · 4 comments
Closed

regression: commit 8647fdc breaks become_method='su' #14116

lifanov opened this issue Jan 25, 2016 · 4 comments
Labels
bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release
Milestone

Comments

@lifanov
Copy link
Contributor

lifanov commented Jan 25, 2016

Issue Type:
  • Bug Report
Ansible Version:

ansible 2.0.0.2
config file = /home/lifanov/.ansible.cfg
configured module search path = /usr/local/share/ansible

Running version 2.0.0.2 with a backport of commit 8647fdc

Ansible Configuration:

Regression is evident with clean config.

Environment:

N/A

Summary:

The above-mentioned commit fixes become_method='sudo' with non-default shells (like /bin/csh on FreeBSD, etc.), so it is important, but it also regresses become_method='su' by incorrectly quoting commands running through "/bin/sh -c".

Steps To Reproduce:

Playbook:


---
- hosts: ws-leeb.ad.nyingma.org
  become: yes
  become_method: su
  gather_facts: false
  tasks:
  - name: install packages
    pkgng: name={{item}} state=present
    with_items:
      - editors/nano
      - net/x11vnc
      - x11/xscreensaver
Expected Results:

Playbook works.

Actual Results:
task path: /usr/local/home/niadmin/packages.yml:7
<ws-leeb.ad.nyingma.org> ESTABLISH CONNECTION FOR USER: None on PORT 22 TO ws-leeb.ad.nyingma.org
<ws-leeb.ad.nyingma.org> EXEC /bin/sh -c '( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1453686702.79-221069478550614 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1453686702.79-221069478550614 )" )'
<ws-leeb.ad.nyingma.org> PUT /tmp/tmptorHDN TO /home/niadmin/.ansible/tmp/ansible-tmp-1453686702.79-221069478550614/pkgng
<ws-leeb.ad.nyingma.org> EXEC /bin/sh -c 'su  root -c "/bin/sh -c '"'"'echo BECOME-SUCCESS-euyywawtqzdtpwanwnukrkzmdlyqrtbv; /bin/sh -c '"'"'"'"'"'"'"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/local/bin/python /home/niadmin/.ansible/tmp/ansible-tmp-1453686702.79-221069478550614/pkgng'"'"'"'"'"'"'"'"''"'"'"'
failed: [ws-leeb.ad.nyingma.org] => (item=[u'editors/nano', u'net/x11vnc', u'x11/xscreensaver']) => {"failed": true, "invocation": {"module_name": "pkgng"}, "item": ["editors/nano", "net/x11vnc", "x11/xscreensaver"], "module_stderr": "", "module_stdout": "Unmatched \".\r\n", "msg": "MODULE FAILURE", "parsed": false}
@bcoca bcoca added bug_report needs_info This issue requires further information. Please answer any outstanding questions. labels Jan 25, 2016
@lifanov
Copy link
Contributor Author

lifanov commented Jan 25, 2016

I updated the summary to fit the template.

@bcoca bcoca removed the needs_info This issue requires further information. Please answer any outstanding questions. label Jan 25, 2016
@bcoca bcoca added this to the stable-2.0 milestone Jan 25, 2016
@bcoca bcoca added the P2 Priority 2 - Issue Blocks Release label Jan 27, 2016
bcoca added a commit that referenced this issue Jan 27, 2016
should not fail anymore on csh, fish nor the BSDs
fixes #14116
@bcoca bcoca closed this as completed in 6bf2f45 Jan 27, 2016
@amenonsen
Copy link
Contributor

This change is, quite frankly, an embarrassment. I posted a fix in November, with analysis and testing on multiple platforms, but that was judged too risky to merge and in need of more testing, to the extent that it wasn't even merged into devel after the 2.0 release. And yet, here's a change that (a) once again doesn't explain what problem it's trying to solve, (b) has not only been applied to devel but backpatched into stable-2.0 immediately, and (c) after all that, is not even correct.

@sivel
Copy link
Member

sivel commented Jan 29, 2016

You can catch more flies with honey than with vinegar

@amenonsen
Copy link
Contributor

I do not want any flies.

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release
Projects
None yet
Development

No branches or pull requests

5 participants