From c323574797acf2045e088ee074b4d97c0bf677b3 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Fri, 15 Jan 2016 19:06:27 -0500 Subject: [PATCH] Check that cwd is absolute Signed-off-by: Mrunal Patel --- spec.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec.go b/spec.go index c4d0edf41f4..5564dd3040b 100644 --- a/spec.go +++ b/spec.go @@ -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 }