Re: "tla build-config" question and suggestion
[email protected] (Ludovic Courtès)
| Newsgroups | gmane.comp.version-control.arch.user |
|---|---|
| Organization | LAAS-CNRS |
| Message-ID | <[email protected]> |
Hi, Thomas Lord <[email protected]> writes: >> Now, it seems that `is_non_upwards_relative_path ()' would also reject >> paths like `chbouib/../foo' which theoretically it should accept. But >> well, arguably, that shouldn't be too much of a problem. ;-) >> > The simpler rule is easy to explain and handling that generality properly > would be pretty tricky. Well, there are `realpath(3)' (which is specified by SuSv2 [0]) and `canonicalize_file_name(3)' (an equivalent GNU extension). These functions handle symlinks as well. Thus, the "right thing" might be to pass paths through them and then check for a common prefix with the (canonicalized) tree root path, rather than use `is_non_upwards_relative_path ()'. This way, Arch would be resistant against maliciously-broken-config attacks. ;-) Thanks, Ludovic. [0] http://www.opengroup.org/onlinepubs/007908799/xsh/realpath.html