Closed Ofenhed closed 2 years ago
Isn't this patch too broad? In other words, it could disguse some real errors.
According to the documentation of secureAbsNormPath
it only returns Nothing if it's not a subpath. The only way to reach higher paths in a chrooted directory are '..', and in the file system those act like '.' in the same directory. If the documentation for secureAbsNormPath
is wrong, then this conclusion is wrong, but otherwise this patch should only make MissingH act more like the Linux file structure.
This PR was rejected (by not merging it).
In the root directory ".." is the same as ".". This is currently not reflected in the missingh chroot functions, instead it throws an error. This breaks ftphs when running in a chrooted directory.
This change removes the error when trying to exit the chroot prison and simply returns the root of the prison.