From 43af03e59a4ffa697e9d8e26e64d421edfabfef7 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Thu, 7 Jun 2018 16:04:55 +0900 Subject: [PATCH] oci-executor: eval symlink for root Signed-off-by: Akihiro Suda --- executor/runcexecutor/executor.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/executor/runcexecutor/executor.go b/executor/runcexecutor/executor.go index 593ecf0a..edffb5bf 100644 --- a/executor/runcexecutor/executor.go +++ b/executor/runcexecutor/executor.go @@ -73,7 +73,10 @@ func New(opt Opt) (executor.Executor, error) { if err != nil { return nil, err } - // TODO: check that root is not symlink to fail early + root, err = filepath.EvalSymlinks(root) + if err != nil { + return nil, err + } runtime := &runc.Runc{ Command: cmd,