cURL / Mailing Lists / curl-library / Single Mail

curl-library

2 NTLM patches

From: Dan Winship <danw_at_ximian.com>
Date: Thu, 10 Jul 2003 10:53:02 -0400

(Both against the latest CVS code.)

Problem 1: NTLM doesn't work with the multi interface, because the
newurl field on the easy_conn never gets cleared, so it keeps resending
the request forever and ever. The attached patch to multi.c fixes that
(possibly incorrectly?).

Problem 2: Passing "" for the domain in the type 3 message won't work on
all servers for all users. (It only works if both the server has a
default domain set, and the user is a member of that domain.) The
attached patch to http_ntlm.c makes it parse usernames of the form
"foo\bar" (or "foo/bar") as domain="foo", username="bar". The reason I
did it that way is because IIS already parses usernames that way when
using Basic auth, so this means you can do

    curl_easy_setopt (curl, CURLOPT_USERPWD, "domain\\user:password");
    curl_easy_setopt (curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM);

and it will do exactly the right thing. (Oh, Problem 2b: the
curl_easy_setopt man page lists the flags by the wrong names:
CURLHTTP_BASIC, etc rather than CURLAUTH_BASIC.)

-- Dan

-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps

Received on 2003-07-10