cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Problem with special chars in ftp passwords

From: Eric VERGNAUD <eric.vergnaud_at_jlynx.com>
Date: Thu, 14 Oct 2004 10:43:55 +0200

le 14/10/04 10:18, Daniel Stenberg à daniel-curl_at_haxx.se a écrit :

> On Wed, 13 Oct 2004, Eric VERGNAUD wrote:
>
>> ftp://user:pass?word@ftp.mydomain.com
>>
>> Curl fails with a "could not resolve host name" error.
>
> ...
>
>> - is it legal to use '?' in ftp passwords ?
>
> As Bill pointed out, it seems it is. libcurl doesn't thinks so though, so it
> fails like this. Use it encoded for now to work around this flaw.

>> - shouldn't the above test be skipped when protocol is ftp or ftps ?
>
> It probably should, but as you can see in the code it has no knowledge about
> that particular protocol it is at that point, and there's no legal function
> for the trailing ?-letter in FTP so I don't think it makes any harm in
> allowing one to terminate the host name.

In fact it knows. The previous test ( a few lines above) already splits the
url correctly. But since there is no trailing path, it returns 2, which
explains why the code falls into that case.

Maybe an initial test for the protocol suffix only would help separating the
tests for path splitting according to the protocol.

> I'll work on a fix.

Cool.

-------------------------------
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
-------------------------------
Received on 2004-10-14