diff --git a/link/uprobe.go b/link/uprobe.go index d53975d53..b38c98f4c 100644 --- a/link/uprobe.go +++ b/link/uprobe.go @@ -6,7 +6,6 @@ import ( "debug/elf" "errors" "fmt" - "io/fs" "os" "sync" @@ -35,8 +34,6 @@ var ( ErrNoSymbol = errors.New("not found") ) -const permExec fs.FileMode = 0111 - // Executable defines an executable program on the filesystem. type Executable struct { // Path of the executable on the filesystem. @@ -113,15 +110,10 @@ func OpenExecutable(path string) (*Executable, error) { return nil, fmt.Errorf("path cannot be empty") } - info, err := os.Stat(path) - if err != nil { + if _, err := os.Stat(path); err != nil { return nil, fmt.Errorf("stat executable: %w", err) } - if info.Mode()&permExec == 0 { - return nil, fmt.Errorf("file %s is not executable", path) - } - return &Executable{ path: path, cachedSymbols: make(map[string]symbol),