Skip to content

Commit c65b359

Browse files
committed
runtime: do not allow runroot longer than 50 characters
Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent f77d846 commit c65b359

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/podman/libpodruntime/runtime.go

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/containers/libpod/pkg/rootless"
66
"github.com/containers/libpod/pkg/util"
77
"github.com/containers/storage"
8+
"github.com/pkg/errors"
89
"github.com/urfave/cli"
910
)
1011

@@ -42,6 +43,9 @@ func GetRuntimeWithStorageOpts(c *cli.Context, storageOpts *storage.StoreOptions
4243
if c.GlobalIsSet("runroot") {
4344
storageOpts.RunRoot = c.GlobalString("runroot")
4445
}
46+
if len(storageOpts.RunRoot) > 50 {
47+
return nil, errors.New("the specified runroot is longer than 50 characters")
48+
}
4549
if c.GlobalIsSet("storage-driver") {
4650
storageOpts.GraphDriverName = c.GlobalString("storage-driver")
4751
}

0 commit comments

Comments
 (0)