Make volumes opts more strict

Upstream-commit: 2bbc90e92ff140c29891e92c9ce320ca7d19cd57
Component: engine
This commit is contained in:
Guillaume J. Charmes
2013-11-28 12:24:04 -08:00
parent 8406ad8872
commit d61719d4a1
+4
View File
@@ -100,6 +100,10 @@ func ValidateLink(val string) (string, error) {
func ValidatePath(val string) (string, error) {
var containerPath string
if strings.Count(val, ":") > 2 {
return val, fmt.Errorf("bad format for volumes: %s", val)
}
splited := strings.SplitN(val, ":", 2)
if len(splited) == 1 {
containerPath = splited[0]