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>
(cherry picked from commit 250886741b)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2024-01-23 17:34:49 +01:00
parent a445aa95e5
commit 3de920a0b1
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

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