From 1a3e191d7e177ca0e6e28918dca73870351163a2 Mon Sep 17 00:00:00 2001 From: zhouhao Date: Wed, 18 Jan 2017 14:05:03 +0800 Subject: [PATCH] runtimetest: add verification Signed-off-by: zhouhao --- cmd/runtimetest/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/runtimetest/main.go b/cmd/runtimetest/main.go index 371052c3b..955be1bba 100644 --- a/cmd/runtimetest/main.go +++ b/cmd/runtimetest/main.go @@ -410,6 +410,10 @@ func validateMaskedPaths(spec *rspec.Spec) error { if err != io.EOF { return fmt.Errorf("%v should not be readable", maskedPath) } + + if !filepath.IsAbs(maskedPath) { + return fmt.Errorf("maskdePath %v is not an absoulte path", maskedPath) + } } return nil } @@ -421,6 +425,10 @@ func validateROPaths(spec *rspec.Spec) error { if err == nil { return fmt.Errorf("%v should be readonly", v) } + + if !filepath.IsAbs(v) { + return fmt.Errorf("readonlyPath %v is not an absoulte path", v) + } } return nil