Skip to content

Commit 8092350

Browse files
committed
Merge pull request #480 from mrunalp/cwd_abs
Check that cwd is absolute
2 parents 54b07da + c323574 commit 8092350

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spec.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ func validateSpec(spec *specs.LinuxSpec, rspec *specs.LinuxRuntimeSpec) error {
297297
if spec.Process.Cwd == "" {
298298
return fmt.Errorf("Cwd property must not be empty")
299299
}
300+
if !filepath.IsAbs(spec.Process.Cwd) {
301+
return fmt.Errorf("Cwd must be an absolute path")
302+
}
300303
return nil
301304
}
302305

0 commit comments

Comments
 (0)