Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions link/uprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"debug/elf"
"errors"
"fmt"
"io/fs"
"os"
"sync"

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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),
Expand Down
Loading