From cafe2812411cfba15b7ece1250a6def29d092366 Mon Sep 17 00:00:00 2001 From: Sylvia Crowe Date: Fri, 29 Dec 2023 12:06:31 -0800 Subject: [PATCH] allow backslash in username This involved converting the regexp string into a raw string to able to use the backslash character. this is important. --- wavesrv/pkg/cmdrunner/cmdrunner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wavesrv/pkg/cmdrunner/cmdrunner.go b/wavesrv/pkg/cmdrunner/cmdrunner.go index 2aa0e784d..011022aa2 100644 --- a/wavesrv/pkg/cmdrunner/cmdrunner.go +++ b/wavesrv/pkg/cmdrunner/cmdrunner.go @@ -115,7 +115,7 @@ var SetVarScopes = []SetVarScope{ {ScopeName: "remote", VarNames: []string{}}, } -var userHostRe = regexp.MustCompile("^(sudo@)?([a-z][a-z0-9._@-]*)@([a-z0-9][a-z0-9.-]*)(?::([0-9]+))?$") +var userHostRe = regexp.MustCompile(`^(sudo@)?([a-z][a-z0-9._@\\-]*)@([a-z0-9][a-z0-9.-]*)(?::([0-9]+))?$`) var remoteAliasRe = regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9._-]*$") var genericNameRe = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_ .()<>,/\"'\\[\\]{}=+$@!*-]*$") var rendererRe = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_.:-]*$")