Merge pull request #4729 from natasha41575/colonInFSName

allow colon in filenames
This commit is contained in:
Kubernetes Prow Robot
2022-07-28 13:13:11 -07:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -569,7 +569,7 @@ func (n *fsNode) DebugPrint() {
})
}
var legalFileNamePattern = regexp.MustCompile("^[a-zA-Z0-9-_.]+$")
var legalFileNamePattern = regexp.MustCompile("^[a-zA-Z0-9-_.:]+$")
// This rules enforced here should be simpler and tighter
// than what's allowed on a real OS.

View File

@@ -34,6 +34,12 @@ var topCases = []pathCase{
arg: ParentDir,
errStr: "illegal name '..' in file creation",
},
{
what: "colon",
arg: "a:b",
name: "a:b",
path: "a:b",
},
{
what: "empty",
arg: "",