Skip to content

Commit

Permalink
Fix regular expression to test for Windows named pipe in SSH agent pa…
Browse files Browse the repository at this point in the history
…th; allowed backslashes in host.

Signed-off-by: Siebe Schaap <siebe@digibites.nl>
  • Loading branch information
sschaap committed May 27, 2021
1 parent f3bdb4a commit c9a5f88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion session/sshforward/sshprovider/agentprovider_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func isWindowsPipePath(path string) bool {
// and requires winio.DialPipe() rather than DialTimeout("unix").
// Slashes and backslashes may be used interchangeably in the path.
// Path separators may consist of multiple consecutive (back)slashes.
pipePattern := strings.ReplaceAll("^[/]{2}[^/]+[/]+pipe[/]+", "[/]", `[\\/]`)
pipePattern := strings.ReplaceAll("^[/]{2}[^/]+[/]+pipe[/]+", "/", `\\/`)
ok, _ := regexp.MatchString(pipePattern, path)
return ok
}
Expand Down

0 comments on commit c9a5f88

Please sign in to comment.