[PATCH] Accept file://localhost/ style urls as local
Giorgos Keramidas
keramida at ceid.upatras.gr
Sun Sep 9 01:20:13 UTC 2007
On 2007-09-08 15:24, Brendan Cully <brendan at kublai.com> wrote:
>On Saturday, 08 September 2007 at 23:30, Christian Ebert wrote:
>>* Jonathan S. Shapiro on Saturday, September 08, 2007 at 10:23:33 -0400
>>> On Sat, 2007-09-08 at 09:24 +0200, Christian Ebert wrote:
>>>> MacOS X' sanity is rather limited:
>>>
>>> Since when is this news?
>>
>> Apart from that, I'm curious about an example where simply dropping
>> the local host component (which is done in case it's empty already
>> for file:///..., or probably would have to done if it's valid) would
>> lead to a different or dangerous result, not from a puristic, but
>> practical Hg point of view. The resulting path is checked for
>> validity. So could there happen anything worse than what happens now,
>> in case you give an invalid path?
>
> I'd like to see an example too (preferably not a theoretical one). It
> seems to me that the host part of a file: URL means either "same host
> you're on" or "this URL is invalid" (since there's no specified way to
> access the other host). This makes the hostname field pretty
> worthless.
How much does it cost to run minimal 'validation' checks on the host
part of file://host/path URIs, if we:
* Assume 'localhost' or '127.0.0.1' is ok
* Check the rest of the hostnames for being local.
If the check takes half a second and it runs only _once_ per URI we get,
then it may be worth the extra 'safety check' for non-local host names.
It may be surprising if we start accepting file://host/path URIs of the
form file://this..is..definitely..a.bogus..hostname/etc
- Giorgos
More information about the Mercurial-devel
mailing list