MCPcopy Index your code
hub / github.com/subtrace/subtrace / resolvePath

Method resolvePath

cmd/run/engine/process/handle.go:90–105  ·  view source on GitHub ↗
(n *seccomp.Notif, dirfd int, pathAddr uintptr)

Source from the content-addressed store, hash-verified

88}
89
90func (p *Process) resolvePath(n *seccomp.Notif, dirfd int, pathAddr uintptr) (string, syscall.Errno, error) {
91 path, errno, err := p.vmReadString(n, pathAddr, unix.PathMax)
92 if errno != 0 || err != nil {
93 return "", errno, err
94 }
95
96 if !filepath.IsAbs(path) {
97 dirpath, errno, err := p.resolveDirfd(dirfd)
98 if errno != 0 || err != nil {
99 return "", errno, err
100 }
101 path = filepath.Join(dirpath, path)
102 }
103
104 return path, 0, nil
105}
106
107// handleOpen handles the open(2) and openat(2) syscalls. We do this in order
108// to inject the ephemeral CA certificate into the system root CA store so that

Callers 3

handleOpenMethod · 0.95
handleFstatatMethod · 0.95
handleStatxMethod · 0.95

Calls 2

vmReadStringMethod · 0.95
resolveDirfdMethod · 0.95

Tested by

no test coverage detected