From 474d95e5a45a320426ae716d7bdc6c18311cd721 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 16 Apr 2018 15:16:00 -0500 Subject: validate dns-search values prior to creation Signed-off-by: baude Closes: #628 Approved by: baude --- cmd/podman/create.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmd/podman') diff --git a/cmd/podman/create.go b/cmd/podman/create.go index a1d3ead20..b95309980 100644 --- a/cmd/podman/create.go +++ b/cmd/podman/create.go @@ -593,6 +593,12 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime, imageName string, return nil, errors.Errorf("cannot pass additional search domains when also specifying '.'") } + // Validate domains are good + for _, dom := range c.StringSlice("dns-search") { + if _, err := validateDomain(dom); err != nil { + return nil, err + } + } ImageVolumes := data.ContainerConfig.Volumes var imageVolType = map[string]string{ -- cgit v1.2.3-54-g00ecf