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

Use simple match instead of regex match in GCE Windows OpenSSH startup script #106245

Merged
merged 1 commit into from
Nov 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions cluster/gce/windows/testonly/install-ssh.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ while($true) {
# https://github.com/PowerShell/Win32-OpenSSH/wiki/Various-Considerations
#
# these files will be append only, only new keys will be added
$found = Select-String -Path $user_keys_file -Pattern $ssh_key
$found = Select-String -Path $user_keys_file -Pattern $ssh_key -SimpleMatch
if ($found -eq $null) {
Add-Content -Encoding UTF8 $user_keys_file $ssh_key
}
$found = Select-String -Path $administrator_keys_file -Pattern $ssh_key
$found = Select-String -Path $administrator_keys_file -Pattern $ssh_key -SimpleMatch
if ($found -eq $null) {
Add-Content -Encoding UTF8 $administrator_keys_file $ssh_key
}
Expand Down