cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Possible bug in Curl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 15 Aug 2003 15:57:09 +0200 (CEST)

On Fri, 15 Aug 2003, Matt Simpson wrote:

> I've found a change in behavior in Curl which may be a bug (or may be
> an unfortunate design change).
>
> I have one machine with
> curl 7.9.3 (powerpc-yellowdog-linux-gnu)
> and another with
> curl 7.10.4 (i386-portbld-freebsd5.1)
>
> On the 7.9.3 version, I can use curl with the -n option and a .netrc
> file to retrieve a file from a password protected site, example:
> curl -m 300 -nfsSo filename http://url

I just tested the exact same approach using 7.10.7:

 curl -m 300 -nvfsSo dump [host]

And it worked just fine.

> On the 7.10.4 version, the same request fails with message: curl: (22) The
> requested file was not found

So can you show us what headers that the site actually returns? Can you also
see (using -v) if curl sends a "Authorization" header in the request?

> If I remove the -f (fail) option, it works.

Please define "works". You mean it doesn't return an error? But what did the
site return then?

> From reading some of the entries in the mailing list archive, it looks like
> the fail option causes curl to fail when it sees the HTTP 401 return code
> requesting authorization. But without the -f, or with the -f on an older
> version, it sends the userid/password and retrieves the file without
> signalling an error,

That -f problem you refer to is for 7.10.6 or later, and only if another auth
type than Basic is set to be used...

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-15