cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1249962 ] FTP via HTTP Proxy/NTLM Auth Bad Output

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sun, 07 Aug 2005 15:40:57 -0700

Bugs item #1249962, was opened at 2005-08-01 20:42
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1249962&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: FTP via HTTP Proxy/NTLM Auth Bad Output

Initial Comment:
When trying to use NTLM/HTTP Proxy with FTP, the
resulting output includes the 407 Error HTML at the top
of the file.

Command example:

curl -O --proxy-ntlm --proxy http://some.proxy:80
--proxy-user domain\user:password
ftp://someftpserver/somefile

Environment: FreeBSD 4.5 Ports Collection (i386)

Result is the HTML output from the original
"Authentication Required" HTML page prepended to the
actual file.

This is seen in 7.13.1. I checked 7.14.0 and CVS and
did not see any comments or changes in the code that
obviously fixed this issue.

Based on some experiments with the -v option and
various ftp and http attempts, my temporary fix was to
change the following line in libcurl's transfer.c
function Curl_readwrite() where the comment is
indicating that "These checks are only made the first
time we are about to write a piece of the body"

if(conn->protocol&PROT_HTTP) {

to

if(conn->protocol&(PROT_HTTP|PROT_FTP)) {

This is a hack at best, as I am sure the correct
solution will involve looking to see if this is an
authentication failure during a proxied FTP or possibly
other non-HTTP protocol attempt, but it got the job
done for me tonight.

Hope this is enough for someone who knows the code much
better than I to get a proper solution committed.

Thanks for your efforts.

--
Jon Grubbs
jon.grubbs_at_ins.com
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2005-08-07 15:40
Message:
Logged In: NO 
Your suggested patch works like a champ!  I knew my hack was
exactly that, a hack :-)
Thanks for the effort!
--Jon
----------------------------------------------------------------------
Comment By: Daniel Stenberg (bagder)
Date: 2005-08-03 15:10
Message:
Logged In: YES 
user_id=1110
Actually, using FTP over a HTTP proxy is actually doing HTTP
all the way as far as libcurl goes. Whatabout using a simple
patch such as this?
--- lib/url.c	28 Jul 2005 21:53:09 -0000	1.471
+++ lib/url.c	3 Aug 2005 22:08:31 -0000
@@ -2795,6 +2795,7 @@
 #ifndef CURL_DISABLE_HTTP
       conn->curl_do = Curl_http;
       conn->curl_done = Curl_http_done;
+      conn->protocol = PROT_HTTP;
 #else
       failf(data, "FTP over http proxy requires HTTP
support built-in!");
       return CURLE_UNSUPPORTED_PROTOCOL;
----------------------------------------------------------------------
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1249962&group_id=976
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-tracker
Received on 2005-08-08

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET