mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
runtime: do not allow runroot longer than 50 characters
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
|||||||
"github.com/containers/libpod/pkg/rootless"
|
"github.com/containers/libpod/pkg/rootless"
|
||||||
"github.com/containers/libpod/pkg/util"
|
"github.com/containers/libpod/pkg/util"
|
||||||
"github.com/containers/storage"
|
"github.com/containers/storage"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -42,6 +43,9 @@ func GetRuntimeWithStorageOpts(c *cli.Context, storageOpts *storage.StoreOptions
|
|||||||
if c.GlobalIsSet("runroot") {
|
if c.GlobalIsSet("runroot") {
|
||||||
storageOpts.RunRoot = c.GlobalString("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") {
|
if c.GlobalIsSet("storage-driver") {
|
||||||
storageOpts.GraphDriverName = c.GlobalString("storage-driver")
|
storageOpts.GraphDriverName = c.GlobalString("storage-driver")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user