Check that cwd is absolute

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel
2016-01-15 19:06:27 -05:00
parent 54b07da69e
commit c323574797
+3
View File
@@ -297,6 +297,9 @@ func validateSpec(spec *specs.LinuxSpec, rspec *specs.LinuxRuntimeSpec) error {
if spec.Process.Cwd == "" {
return fmt.Errorf("Cwd property must not be empty")
}
if !filepath.IsAbs(spec.Process.Cwd) {
return fmt.Errorf("Cwd must be an absolute path")
}
return nil
}