Use system temporary directory for known_hosts file#1709
Merged
MarkEWaite merged 1 commit intojenkinsci:stable-6.4from Dec 16, 2025
Merged
Conversation
Windows ssh.exe 9.5p1 and ssh.exe 9.5p2 will not read the known_hosts file if there is a space character in the path to the file. Since we already use the system temporary directory for other scripts that do not contain sensitive information, we'll use it for the known_hosts file as well. The contents of the known_hosts file is not sensitive information. Testing done: * Confirmed that without this change, Windows ssh.exe does not read the known_hosts file when using a manually verified known_hosts file from a workspace that has spaces in its absolute path. * Confirmed that with this change, Windows ssh.exe reads the known_hosts file when using a manually verified known_hosts file from a workspace that has spaces in its absolute path. Fixes jenkinsci#1703
Contributor
Author
|
@mikecirioli I plan to release this as soon as it passes the CI checks. I'd like you to review the change, even if your review happens after the release. I'll need to think more about techniques that might be used to include an automated test for this case. |
Contributor
Author
The simplest tests for that code would be to use real ssh credentials by cloning from a local repository over ssh. However, that requires more setup than I'm ready to do with the time available currently. I am accepting that this change does not have an automated test. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use system temporary directory for known_hosts file
Windows ssh.exe 9.5p1 and ssh.exe 9.5p2 will not read the known_hosts file if there is a space character in the path to the file.
Since we already use the system temporary directory for other scripts that do not contain sensitive information, we'll use it for the known_hosts file as well. The contents of the known_hosts file is not sensitive information.
Fixes #1703
Amends 5a271e5
Testing done
Submitter checklist
Ensure you have provided tests that demonstrate the feature works or the issue is fixed