Merge pull request #480 from mrunalp/cwd_abs

Check that cwd is absolute
This commit is contained in:
Qiang Huang 2016-01-18 10:09:02 +08:00
commit 809235019f
1 changed files with 3 additions and 0 deletions

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
}