MCPcopy Create free account
hub / github.com/SethGammon/Citadel / isSafeBashCommand

Function isSafeBashCommand

hooks_src/permission-request.js:75–79  ·  view source on GitHub ↗
(command)

Source from the content-addressed store, hash-verified

73 const canonicalBase = realpath(resolved);
74 return path.resolve(canonicalBase, ...missing);
75}
76
77function isContainedPath(candidate, root) {
78 const relative = path.relative(root, candidate);
79 return relative === '' || (
80 relative !== '..'
81 && !relative.startsWith(`..${path.sep}`)
82 && !path.isAbsolute(relative)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected