ValidateChild reports whether the cleaned name is a lexically contained path, using the host operating system's path rules. Joining it to a root stays lexically within that root. Nested paths and names that clean to "." are allowed. This check does not consult the filesystem or the current working
(name string)
| 276 | // This check does not consult the filesystem or the current working directory, |
| 277 | // and does not account for symbolic links. |
| 278 | func ValidateChild(name string) error { |
| 279 | _, err := validateChildPath(name) |
| 280 | return err |
| 281 | } |
| 282 | |
| 283 | func validateChildPath(name string) (string, error) { |
| 284 | local := filepath.Clean(name) |
no test coverage detected