summaryrefslogtreecommitdiff
path: root/libpod/boltdb_state_internal.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-02-21 09:42:22 -0500
committerMatthew Heon <matthew.heon@pm.me>2019-02-26 09:37:00 -0500
commitd41d8d090e330fe2f0a3c75d24c409d9c345f841 (patch)
treeaf3c98f4ff6b6874202990e13131a4dbc9566950 /libpod/boltdb_state_internal.go
parentda70c9db6fb92c69d722d51873840c4e54dbe86d (diff)
downloadpodman-d41d8d090e330fe2f0a3c75d24c409d9c345f841.tar.gz
podman-d41d8d090e330fe2f0a3c75d24c409d9c345f841.tar.bz2
podman-d41d8d090e330fe2f0a3c75d24c409d9c345f841.zip
Validate VolumePath against DB configuration
If this doesn't match, we end up not being able to access named volumes mounted into containers, which is bad. Use the same validation that we use for other critical paths to ensure this one also matches. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/boltdb_state_internal.go')
-rw-r--r--libpod/boltdb_state_internal.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/libpod/boltdb_state_internal.go b/libpod/boltdb_state_internal.go
index 3d749849d..936ccbf4c 100644
--- a/libpod/boltdb_state_internal.go
+++ b/libpod/boltdb_state_internal.go
@@ -38,6 +38,7 @@ const (
graphRootName = "graph-root"
graphDriverName = "graph-driver-name"
osName = "os"
+ volPathName = "volume-path"
)
var (
@@ -67,6 +68,7 @@ var (
graphRootKey = []byte(graphRootName)
graphDriverKey = []byte(graphDriverName)
osKey = []byte(osName)
+ volPathKey = []byte(volPathName)
)
// Check if the configuration of the database is compatible with the
@@ -105,10 +107,15 @@ func checkRuntimeConfig(db *bolt.DB, rt *Runtime) error {
return err
}
- return validateDBAgainstConfig(configBkt, "storage graph driver",
+ if err := validateDBAgainstConfig(configBkt, "storage graph driver",
rt.config.StorageConfig.GraphDriverName,
graphDriverKey,
- storage.DefaultStoreOptions.GraphDriverName)
+ storage.DefaultStoreOptions.GraphDriverName); err != nil {
+ return err
+ }
+
+ return validateDBAgainstConfig(configBkt, "volume path",
+ rt.config.VolumePath, volPathKey, "")
})
return err