aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/libpodruntime
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-10-26 16:42:28 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2018-10-30 15:35:24 +0100
commitc65b3599cc3ab6972f1b5d96f3e712cd86d74833 (patch)
tree6ca4f84e2144b8ea878d93eda76179cbf29227df /cmd/podman/libpodruntime
parentf77d846536718950575fa5206d9e3654ba140590 (diff)
downloadpodman-c65b3599cc3ab6972f1b5d96f3e712cd86d74833.tar.gz
podman-c65b3599cc3ab6972f1b5d96f3e712cd86d74833.tar.bz2
podman-c65b3599cc3ab6972f1b5d96f3e712cd86d74833.zip
runtime: do not allow runroot longer than 50 characters
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman/libpodruntime')
-rw-r--r--cmd/podman/libpodruntime/runtime.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/libpodruntime/runtime.go b/cmd/podman/libpodruntime/runtime.go
index df422eb81..a4b3581be 100644
--- a/cmd/podman/libpodruntime/runtime.go
+++ b/cmd/podman/libpodruntime/runtime.go
@@ -5,6 +5,7 @@ import (
"github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/pkg/util"
"github.com/containers/storage"
+ "github.com/pkg/errors"
"github.com/urfave/cli"
)
@@ -42,6 +43,9 @@ func GetRuntimeWithStorageOpts(c *cli.Context, storageOpts *storage.StoreOptions
if c.GlobalIsSet("runroot") {
storageOpts.RunRoot = c.GlobalString("runroot")
}
+ if len(storageOpts.RunRoot) > 50 {
+ return nil, errors.New("the specified runroot is longer than 50 characters")
+ }
if c.GlobalIsSet("storage-driver") {
storageOpts.GraphDriverName = c.GlobalString("storage-driver")
}