MCPcopy
hub / github.com/larksuite/cli / requireAbsolutePath

Function requireAbsolutePath

internal/binding/audit.go:73–78  ·  view source on GitHub ↗

requireAbsolutePath rejects relative paths; relative paths would depend on the process cwd and defeat the point of a static audit. Shell-style shortcuts like `~` are home-relative, not cwd-relative — they are an orthogonal concern and the audit is intentionally Go-stdlib strict here. Callers that ac

(target, label string)

Source from the content-addressed store, hash-verified

71// Callers that accept user-authored config (e.g. resolveFileRef) must
72// pre-resolve any such shortcuts before passing the path in.
73func requireAbsolutePath(target, label string) error {
74 if !filepath.IsAbs(target) {
75 return fmt.Errorf("%s: path must be absolute, got %q", label, target)
76 }
77 return nil
78}
79
80// lstatNonDir stats the path without following symlinks, rejecting
81// directories. Returns the stat info for downstream steps to reuse.

Callers 1

AssertSecurePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected