mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fixed raw return check for privilege escalation
This commit is contained in:
parent
5eae435357
commit
b783ea94bb
1 changed files with 2 additions and 2 deletions
|
@ -48,7 +48,7 @@ class ActionModule(object):
|
||||||
# for some modules (script, raw), the sudo success key
|
# for some modules (script, raw), the sudo success key
|
||||||
# may leak into the stdout due to the way the sudo/su
|
# may leak into the stdout due to the way the sudo/su
|
||||||
# command is constructed, so we filter that out here
|
# command is constructed, so we filter that out here
|
||||||
if result.get('stdout','').strip().startswith('SUDO-SUCCESS-'):
|
if result.get('stdout','').strip().startswith('BECOME-SUCCESS-'):
|
||||||
result['stdout'] = re.sub(r'^((\r)?\n)?SUDO-SUCCESS.*(\r)?\n', '', result['stdout'])
|
result['stdout'] = re.sub(r'^((\r)?\n)?BECOME-SUCCESS.*(\r)?\n', '', result['stdout'])
|
||||||
|
|
||||||
return ReturnData(conn=conn, result=result)
|
return ReturnData(conn=conn, result=result)
|
||||||
|
|
Loading…
Reference in a new issue