Check that cwd is absolute
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
54b07da69e
commit
c323574797
3
spec.go
3
spec.go
|
@ -297,6 +297,9 @@ func validateSpec(spec *specs.LinuxSpec, rspec *specs.LinuxRuntimeSpec) error {
|
||||||
if spec.Process.Cwd == "" {
|
if spec.Process.Cwd == "" {
|
||||||
return fmt.Errorf("Cwd property must not be empty")
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue