MCPcopy
hub / github.com/filebrowser/filebrowser / checkParent

Function checkParent

http/resource.go:264–276  ·  view source on GitHub ↗
(src, dst string)

Source from the content-addressed store, hash-verified

262}
263
264func checkParent(src, dst string) error {
265 rel, err := filepath.Rel(src, dst)
266 if err != nil {
267 return err
268 }
269
270 rel = filepath.ToSlash(rel)
271 if !strings.HasPrefix(rel, "../") && rel != ".." && rel != "." {
272 return fberrors.ErrSourceIsParent
273 }
274
275 return nil
276}
277
278func addVersionSuffix(source string, afs afero.Fs) string {
279 counter := 1

Callers 1

resourcePatchHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected