Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] Fix shell.KEY_VALID_RE to match host authenticity message. Fixes #62782 #66326

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bendikro
Copy link

@bendikro bendikro commented Apr 8, 2024

The shell.KEY_VALID_RE regex only matches messages containing '(yes/no)', and not messages containing '(yes/no/[fingerprint])' This leads to the salt-ssh command hanging, (Shell._run_cmd waits for data on stdout) while the ssh command is waiting on input.

Fix by updating the KEY_VALID_RE regex to match both prompts

What does this PR do?

Fixes a bug where salt-ssh hangs (waiting for more output), while ssh is waiting on input from user.

What issues does this PR fix or reference?

Fixes #62782

Previous Behavior

When output containing (yes/no) is found, salt-ssh exits and prints the output from ssh about host authenticity

New Behavior

When output containing (yes/no) or (yes/no/[fingerprint]) is found, salt-ssh exits and prints the output from ssh about host authenticity

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

…stack#62782

The shell.KEY_VALID_RE regex only matches messages containing '(yes/no)',
and not messages containing '(yes/no/[fingerprint])'
This leads to the salt-ssh command hanging, (Shell._run_cmd waits for data on stdout)
while the ssh command is waiting on input.

Fix by updating the KEY_VALID_RE regex to match both prompts
@bendikro bendikro requested a review from a team as a code owner April 8, 2024 17:55
@bendikro bendikro requested review from felippeb and removed request for a team April 8, 2024 17:55
Copy link

welcome bot commented Apr 8, 2024

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Fix shell.KEY_VALID_RE to match host authenticity message. Fixes #62782 [master] Fix shell.KEY_VALID_RE to match host authenticity message. Fixes #62782 Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] salt-ssh hanging due to non-exposed host key acceptance prompt
1 participant