mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-01 12:40:22 -07:00
Merge pull request #7539 from jimi-c/issue_7503_freebsd_su_fixes
Fixes for su on freebsd
This commit is contained in:
commit
92f16b3d6f
4 changed files with 20 additions and 6 deletions
|
@ -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))
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue