ソースを参照

volume/local: Fix cifs url containing spaces

Unescapes the URL to avoid passing an URL encoded address to the kernel.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski 1 年間 前
コミット
250886741b
1 ファイル変更5 行追加1 行削除
  1. 5 1
      volume/local/local_unix.go

+ 5 - 1
volume/local/local_unix.go

@@ -151,7 +151,11 @@ func getMountOptions(opts *optsConfig, resolveIP func(string, string) (*net.IPAd
 				return "", "", errors.Wrap(err, "error resolving passed in network volume address")
 			}
 			deviceURL.Host = ipAddr.String()
-			mountDevice = deviceURL.String()
+			dev, err := url.QueryUnescape(deviceURL.String())
+			if err != nil {
+				return "", "", fmt.Errorf("failed to unescape device URL: %q", deviceURL)
+			}
+			mountDevice = dev
 		}
 	}