Handle condition going from privileged to non-privileged user in whic… #805
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…h the cwd disables descent.
Fall back to Mitogen's temporary directory. Related to #636.
Allows Mitogen to fallback to a safe temporary directory when become is used and become_user cannot use the cwd. For example, fixes the following code assuming directory of
playbook_dir
is owned by root with permission 0700.Previously, os.chdir fails:
With this change it succeeds falling back to /var/tmp restoring normal Ansible operation.
Debug log from the task.
I believe a test case wouldn't hurt; however, I'm not terribly great with Python and wouldn't know where to begin with creating a non-privileged user or skipping the test if "become" is unavailable.