-
Notifications
You must be signed in to change notification settings - Fork 34
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
Quote removal off-by-one (on ansible core 2.11.2) #34
Comments
Have also had to work around this. |
Fixes #34. There are some cases where quote stripping (needed when ansible would otherwise try to run sudo in a jail) would remove too little or too many quotes. This attempts to rectify this using shlex-based parsing (mostly).
@austinhyde I tested your PR this morning by removing my hack, documented above, and it seems to work now. Thanks for spending time on this! |
@mcgaw @austinhyde I commented on #36, so in general it works, but having a minimum ansible version check would be useful - opened #37 to address this. |
@grembo I'm using ansible 2.10.6, which seems to be less than the minimum ansible version you mentioned? Sorry if I've picked you up wrong. |
@mcgaw It seems like this was due to a bug introduced in ansible in ansible/ansible@935528e#diff-38cec806ea1a1ee7c3a286c7865334ecfba7ccc49e21d4e8fb8ec1b17938fda6, which affected 2.11.0, 2.11.1, and 2.11.2. It was corrected it ansible/ansible@a2239d8, which made it to 2.11.3. So maybe minimum version isn't exactly the right way of addressing this (could be useful to have such a check anyway). |
I mentioned it on the PR too, but I'm seeing the same quoting bug on 2.12.1. |
Yes, like mentioned on the PR, this is a bug in sshjail that is fixed in #36 (which probably should land/be released). The problems with specific ansible versions were unrelated and just noticed while testing the change. |
Fixes austinhyde#34. There are some cases where quote stripping (needed when ansible would otherwise try to run sudo in a jail) would remove too little or too many quotes. This attempts to rectify this using shlex-based parsing (mostly).
Changing this line
ansible-sshjail/sshjail.py
Line 357 in 981674f
to
fixes the issue (even if it's just a workaround).
Example playbook that fails without the patch:
The text was updated successfully, but these errors were encountered: