MCPcopy Index your code
hub / github.com/aptly-dev/aptly / verifyPath

Function verifyPath

api/files.go:20–30  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

18var syncFile = func(f *os.File) error { return f.Sync() }
19
20func verifyPath(path string) bool {
21 path = filepath.Clean(path)
22 for _, part := range strings.Split(path, string(filepath.Separator)) {
23 if part == ".." || part == "." {
24 return false
25 }
26 }
27
28 return true
29
30}
31
32func verifyDir(c *gin.Context) bool {
33 if !verifyPath(c.Params.ByName("dir")) {

Callers 6

apiReposPackageFromDirFunction · 0.85
verifyDirFunction · 0.85
apiFilesUploadOneFunction · 0.85
apiFilesDeleteFileFunction · 0.85
TestVerifyPathMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestVerifyPathMethod · 0.68