cURL / Mailing Lists / curl-library / Single Mail

curl-library

weird proxy authorization behaviour with gksudo

From: Tamás Lustyik - NTRglobal <tlustyik_at_ntrglobal.com>
Date: Mon, 19 Oct 2009 17:06:24 +0200

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
Received on 2009-10-19