cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: weird proxy authorization behaviour with gksudo

From: Tamás Lustyik - NTRglobal <tlustyik_at_ntrglobal.com>
Date: Mon, 19 Oct 2009 18:33:00 +0200

Hi,

I have found the reason, CURLOPT_PROXYAUTH was not set in case there
was no proxy configuration found in the environment variables. My bad.
(Although I still don't get why the explicit setenv had no effect on
the proxy detection, but anyway.)

Tamas

El 19/10/2009, a las 17:06, Tamás Lustyik - NTRglobal escribió:

> Hello and greetings to everyone in the list,
>
>
> I have bumped into a weird problem using libcurl 7.19.6 (compiled
> from source with --disable-ldap as only modifier to configure) on
> Ubuntu 8.04.
>
> The use case is the following. My Ubuntu has the http proxy well
> configured (firefox can surf with proxy settings set to use that of
> the system). According to the 407 response headers, the proxy
> supports NTLM, Kerberos and Negotiate authorization but doesn't
> mention Basic. I have a small GUI application that uses libcurl to
> retrieve a page from another site. (Linked statically if this
> counts.) When the app sees that the request has failed with a 407,
> it resubmits the request after having set the CURLOPT_PROXY,
> CURLOPT_PROXYUSERPWD and CURLOPT_PROXYAUTH variables.
>
> Now comes the interesting part. If I execute the app as a regular
> user, it authenticates flawlessly with NTLM. If I run it with sudo
> from a terminal window, same result. However, if I launch it with
> gksudo, while resending the request, libcurl tries to authenticate
> using Basic authentication!
>
> I suspect that it may be related to the environment variables since
> execution with gksudo -k (-k keeps the env) also results in correct
> behaviour. I tried setenv'ing http_proxy explicitly from the code
> before doing anything but it didn't make any difference. I also
> checked the values of all_proxy and no_proxy but they were unset in
> either case, so were the respective uppercase variables.
>
> Can anybody else reproduce this? Is there another environment
> variable that I haven't considered?
>
>
> Regards,
> Tamas
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-10-19