From 535d9cc59fe75abebcbcfea60a8ff0f5f795beb1 Mon Sep 17 00:00:00 2001 From: Samuel Karp Date: Tue, 25 May 2021 00:19:35 -0700 Subject: [PATCH] ctr: parse mount options with embedded = character FreeBSD mount options may have embedded = characters. For example, devfs(5) supports the `ruleset` option which can be passed as `ruleset=4` to indicate that ruleset 4 should be used. Signed-off-by: Samuel Karp --- cmd/ctr/commands/run/run.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ctr/commands/run/run.go b/cmd/ctr/commands/run/run.go index c893142be..162bf1470 100644 --- a/cmd/ctr/commands/run/run.go +++ b/cmd/ctr/commands/run/run.go @@ -63,8 +63,8 @@ func parseMountFlag(m string) (specs.Mount, error) { } for _, field := range fields { - v := strings.Split(field, "=") - if len(v) != 2 { + v := strings.SplitN(field, "=", 2) + if len(v) < 2 { return mount, fmt.Errorf("invalid mount specification: expected key=val") }