summaryrefslogtreecommitdiff
path: root/cmd/podman/shared
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2019-08-08 08:59:35 -0700
committerJhon Honce <jhonce@redhat.com>2019-08-09 09:58:39 -0700
commitf070913c6a7fa1e5b79b637237bfe68d15742202 (patch)
tree0aef038f6ab977389b41e4064fb26744bc2a4f6d /cmd/podman/shared
parentdc3816819d24921dfe8204e79d383c9ecea46612 (diff)
downloadpodman-f070913c6a7fa1e5b79b637237bfe68d15742202.tar.gz
podman-f070913c6a7fa1e5b79b637237bfe68d15742202.tar.bz2
podman-f070913c6a7fa1e5b79b637237bfe68d15742202.zip
Improve dns-search validation, empty domains now return an error
Fixes #3426 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/shared')
-rw-r--r--cmd/podman/shared/create.go5
1 files changed, 5 insertions, 0 deletions
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 == "." {