VerifyPath verifies that path is based in basePath.
(path, basePath string)
| 24 | |
| 25 | // VerifyPath verifies that path is based in basePath. |
| 26 | func VerifyPath(path, basePath string) error { |
| 27 | c := filepath.Clean(filepath.Join(basePath, path)) |
| 28 | return InTrustedRoot(c, filepath.Clean(basePath)) |
| 29 | } |
| 30 | |
| 31 | // SanitizeFileName sanitizes the given filename |
| 32 | func SanitizeFileName(fileName string) string { |
no test coverage detected