Add filename checking and canonicalization
I'm not sure if libredox is the right place for this, but the following functionality is required by relibc, redoxfs and contain.
- check if a filename is valid. Currently, there are random places in the code that either assume ':' is disallowed, or return error if it is present.
- check if a scheme name is valid. Currently, there are several places that incorrectly accept paths containing a ':' that follows a '/', which then leads to incorrectly assuming that a scheme is present. Validating a scheme name more thoroughly would unmask some of these bugs. Note that this functionality is also required in
std::path
to determine if the path contains a Scheme prefix. - canonicalize a file path. This involves checking for a scheme, determining if the path is absolute, deleting `name/..' and disallowing backing up past the root of the scheme. It's complex enough that it should not be duplicated.
- resolve a symbolic link. This code is part of relibc's canonicalize, and is needed by contain. We should treat it as a separate problem. Perhaps it is outside the scope of this cluster of functionality and should be addressed separately.