mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
Properly quote the username to support usernames with spaces (#53420)
This commit is contained in:
2
changelogs/fragments/ssh-quote-user.yaml
Normal file
2
changelogs/fragments/ssh-quote-user.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- ssh - Properly quote the username to allow usernames containing spaces (https://github.com/ansible/ansible/issues/49968)
|
||||||
@@ -612,7 +612,7 @@ class Connection(ConnectionBase):
|
|||||||
if user:
|
if user:
|
||||||
self._add_args(
|
self._add_args(
|
||||||
b_command,
|
b_command,
|
||||||
(b"-o", b"User=" + to_bytes(self._play_context.remote_user, errors='surrogate_or_strict')),
|
(b"-o", b'User="%s"' % to_bytes(self._play_context.remote_user, errors='surrogate_or_strict')),
|
||||||
u"ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set"
|
u"ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user