From 33e58486bc6c5f8c878d5e18c8cbc89e369de1bb Mon Sep 17 00:00:00 2001 From: BianTanggui Date: Wed, 6 Jul 2022 11:32:49 +0800 Subject: [PATCH] Match-id-aa9414be36c97beb23076851f9ad503951c01ac4 --- runtime/main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runtime/main.go b/runtime/main.go index c41b92d..c2fedd5 100644 --- a/runtime/main.go +++ b/runtime/main.go @@ -13,6 +13,7 @@ import ( "os" "os/exec" "path" + "path/filepath" "strings" "syscall" @@ -94,13 +95,17 @@ func initLogModule(stopCh <-chan struct{}) error { } var execRunc = func() error { - runcPath, err := exec.LookPath(dockerRuncName) + tempRuncPath, err := exec.LookPath(dockerRuncName) if err != nil { - runcPath, err = exec.LookPath(runcName) + tempRuncPath, err = exec.LookPath(runcName) if err != nil { return fmt.Errorf("failed to find the path of runc: %v", err) } } + runcPath, err := filepath.EvalSymlinks(tempRuncPath) + if err != nil { + return fmt.Errorf("failed to find realpath of runc %v", err) + } if _, err := mindxcheckutils.RealFileChecker(runcPath, true, false, mindxcheckutils.DefaultSize); err != nil { return err }