From f070913c6a7fa1e5b79b637237bfe68d15742202 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Thu, 8 Aug 2019 08:59:35 -0700 Subject: Improve dns-search validation, empty domains now return an error Fixes #3426 Signed-off-by: Jhon Honce --- cmd/podman/shared/create.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd') diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go index 7dccc41f1..24279b871 100644 --- a/cmd/podman/shared/create.go +++ b/cmd/podman/shared/create.go @@ -627,6 +627,11 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod. return nil, errors.Errorf("cannot pass additional search domains when also specifying '.'") } + // Check for explicit dns-search domain of '' + if c.Changed("dns-search") && len(c.StringSlice("dns-search")) == 0 { + return nil, errors.Errorf("'' is not a valid domain") + } + // Validate domains are good for _, dom := range c.StringSlice("dns-search") { if dom == "." { -- cgit v1.2.3-54-g00ecf