mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Merge pull request #7539 from jimi-c/issue_7503_freebsd_su_fixes
Fixes for su on freebsd
This commit is contained in:
@@ -950,9 +950,9 @@ def make_su_cmd(su_user, executable, cmd):
|
||||
"""
|
||||
# TODO: work on this function
|
||||
randbits = ''.join(chr(random.randint(ord('a'), ord('z'))) for x in xrange(32))
|
||||
prompt = 'assword: '
|
||||
prompt = '[Pp]assword: ?$'
|
||||
success_key = 'SUDO-SUCCESS-%s' % randbits
|
||||
sudocmd = '%s %s %s %s -c %s' % (
|
||||
sudocmd = '%s %s %s -c "%s -c %s"' % (
|
||||
C.DEFAULT_SU_EXE, C.DEFAULT_SU_FLAGS, su_user, executable or '$SHELL',
|
||||
pipes.quote('echo %s; %s' % (success_key, cmd))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user