MCPcopy Create free account
hub / github.com/Illusionna/LocalTransfer / AccessSuperPath

Function AccessSuperPath

utils.go:104–109  ·  view source on GitHub ↗

禁止 API 使用 ".." 或绝对路径越界访问共享文件的夹祖父目录.

(path string)

Source from the content-addressed store, hash-verified

102
103// 禁止 API 使用 ".." 或绝对路径越界访问共享文件的夹祖父目录.
104func AccessSuperPath(path string) bool {
105 if strings.Contains(path, "..") || filepath.IsAbs(path) {
106 return false
107 }
108 return true
109}
110
111
112// 授权功能状态中间件, status 和 utils.PARAMS.__STATUS 两个不同的指针, 指向同一个内存地址.

Callers 7

FileInfoHandlerFunction · 0.85
SearchFileFunction · 0.85
DeleteSelectedFileFunction · 0.85
ArchiveZipFunction · 0.85
CopySelectedFileFunction · 0.85
MoveSelectedFileFunction · 0.85
RenameSelectedFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected