mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Ported over #7158 to support SELinux context switches.
This commit is contained in:
parent
8548690ca3
commit
d9f873495e
4 changed files with 28 additions and 1 deletions
|
@ -453,7 +453,9 @@ class ActionBase:
|
|||
self._display.debug("no command, exiting _low_level_execute_command()")
|
||||
return dict(stdout='', stderr='')
|
||||
|
||||
if sudoable and self._play_context.become and self._play_context.become_user != self._play_context.remote_user:
|
||||
allow_same_user = C.BECOME_ALLOW_SAME_USER
|
||||
same_user = self._play_context.become_user == self._play_context.remote_user
|
||||
if sudoable and self._play_context.become and (allow_same_user or not same_user):
|
||||
self._display.debug("using become for this command")
|
||||
cmd = self._play_context.make_become_cmd(cmd, executable=executable)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue