Match-id-aa9414be36c97beb23076851f9ad503951c01ac4

This commit is contained in:
BianTanggui
2022-07-06 11:32:49 +08:00
parent 532ce4cf4d
commit 33e58486bc

View File

@@ -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
}