cURL / Mailing Lists / curl-library / Single Mail

curl-library

FIX for bug 440

From: Arunav Sanyal <arunav.sanyal91_at_gmail.com>
Date: Mon, 25 Mar 2013 16:47:04 +0530

Reference http://sourceforge.net/p/curl/bugs/440/

In order to fix this do the following changes to libcurl:-

comment out/remove the portion
  /* commented out by arunav to fix bug 440
  if((conn->bits.httpproxy && conn->bits.proxy_user_passwd) ||
     conn->bits.user_passwd)
   else
    authhost->done = TRUE;
    authproxy->done = TRUE;
    return CURLE_OK; /* no authentication with no user or password */
  }
  */

in Curl_http_output_auth() function declaration in http.c

and

change the following parts in Curl_http_auth_act:-

Before:-

if(conn->bits.user_passwd &&
     ((data->req.httpcode == 401) ||
      (conn->bits.authneg && data->req.httpcode < 300))) {
    pickhost = pickoneauth(&data->state.authhost);
    if(!pickhost)
      data->state.authproblem = TRUE;
  }
  if(conn->bits.proxy_user_passwd &&
     ((data->req.httpcode == 407) ||
      (conn->bits.authneg && data->req.httpcode < 300))) {
    pickproxy = pickoneauth(&data->state.authproxy);
    if(!pickproxy)
      data->state.authproblem = TRUE;
  }

After:-
 if(((data->req.httpcode == 401) ||
      (conn->bits.authneg && data->req.httpcode < 300))) {
    pickhost = pickoneauth(&data->state.authhost);
    if(!pickhost)
      data->state.authproblem = TRUE;
  }
  if(((data->req.httpcode == 407) ||
      (conn->bits.authneg && data->req.httpcode < 300))) {
    pickproxy = pickoneauth(&data->state.authproxy);
    if(!pickproxy)
      data->state.authproblem = TRUE;
  }

Tested on curl 7.28.1 with spnego and gss-negotiate support

Potential issues - Since this is also going to affect basic, digest and
ntlm, i do not know the side effects of this fix on these mechanisms. If
there are error handling mechanisms in their respective functions, there
would be nothing to worry about.

-- 
Arunav Sanyal
4th year undergraduate student
B.E (Hons) Computer Science
BITS Pilani K.K Birla Goa Campus

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-25