diff options
author | Valentin Rothberg <vrothberg@redhat.com> | 2022-08-25 10:06:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-25 10:06:55 +0200 |
commit | 274a533ef14525350d606f8e455df9631db7e467 (patch) | |
tree | 22d1f116c44a126a1f1ddc22f93826116bba65a2 /cmd | |
parent | c9565b051c3843e5bad63f062f8c3125c548dd63 (diff) | |
parent | 19a617eaab02c27b0975333bb2c1db0998ce4d59 (diff) | |
download | podman-274a533ef14525350d606f8e455df9631db7e467.tar.gz podman-274a533ef14525350d606f8e455df9631db7e467.tar.bz2 podman-274a533ef14525350d606f8e455df9631db7e467.zip |
Merge pull request #15455 from baude/issue15247
Allow colons in windows file paths
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/parse/net.go | 9 | ||||
-rw-r--r-- | cmd/podman/parse/parse.go | 18 | ||||
-rw-r--r-- | cmd/podman/parse/parse_windows.go | 5 |
3 files changed, 23 insertions, 9 deletions
diff --git a/cmd/podman/parse/net.go b/cmd/podman/parse/net.go index 9228c7127..a5c7a0d95 100644 --- a/cmd/podman/parse/net.go +++ b/cmd/podman/parse/net.go @@ -151,15 +151,6 @@ func parseEnvOrLabelFile(envOrLabel map[string]string, filename, configType stri return scanner.Err() } -// ValidateFileName returns an error if filename contains ":" -// as it is currently not supported -func ValidateFileName(filename string) error { - if strings.Contains(filename, ":") { - return fmt.Errorf("invalid filename (should not contain ':') %q", filename) - } - return nil -} - // ValidURL checks a string urlStr is a url or not func ValidURL(urlStr string) error { url, err := url.ParseRequestURI(urlStr) diff --git a/cmd/podman/parse/parse.go b/cmd/podman/parse/parse.go new file mode 100644 index 000000000..47db066d3 --- /dev/null +++ b/cmd/podman/parse/parse.go @@ -0,0 +1,18 @@ +//go:build !windows +// +build !windows + +package parse + +import ( + "fmt" + "strings" +) + +// ValidateFileName returns an error if filename contains ":" +// as it is currently not supported +func ValidateFileName(filename string) error { + if strings.Contains(filename, ":") { + return fmt.Errorf("invalid filename (should not contain ':') %q", filename) + } + return nil +} diff --git a/cmd/podman/parse/parse_windows.go b/cmd/podman/parse/parse_windows.go new file mode 100644 index 000000000..794f4216d --- /dev/null +++ b/cmd/podman/parse/parse_windows.go @@ -0,0 +1,5 @@ +package parse + +func ValidateFileName(filename string) error { + return nil +} |