Browse Source

Make volumes opts more strict

Guillaume J. Charmes 11 năm trước cách đây
mục cha
commit
2bbc90e92f
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      opts.go

+ 4 - 0
opts.go

@@ -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]