After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 84315 - Gnome-session could set http_proxy in environment
Gnome-session could set http_proxy in environment
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: general
1.5.x
Other All
: Normal enhancement
: ---
Assigned To: Session Maintainers
Session Maintainers
: 148421 (view as bug list)
Depends on:
Blocks: 113219
 
 
Reported: 2002-06-05 23:51 UTC by ssmith
Modified: 2007-01-06 14:58 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
gnome-session-http-proxy.patch (3.95 KB, patch)
2006-09-06 16:02 UTC, Ray Strode [halfline]
needs-work Details | Review
move code to gsm-proxy.[ch] (6.64 KB, patch)
2006-10-27 01:23 UTC, Ray Strode [halfline]
committed Details | Review
committed change that swaps @ and : in http_proxy variable (2.19 KB, patch)
2006-11-27 04:17 UTC, Ray Strode [halfline]
committed Details | Review
don't set http_proxy if user's proxy requires authentication (3.72 KB, patch)
2006-11-27 05:01 UTC, Ray Strode [halfline]
none Details | Review

Description ssmith 2002-06-05 23:51:09 UTC
In gnome2 it is possible to set the location of the network HTTP proxy.

It would be useful if gnome-session could set the environment variable
http_proxy (and other related ones) to the value given, so that it may be
picked up by non-gnome applications run from within the session (e.g. Lynx
or wget run from an gnome-terminal).
Comment 1 Murray Cumming 2003-07-09 08:30:29 UTC
Is this really GNOME's job? Personally I think not.
Comment 2 Mark McLoughlin 2003-07-09 09:38:13 UTC
Hmm, I meant to close this. I agree, this isn't something GNOME should
be doing.
Comment 3 David Sedeño Fernández 2004-07-29 22:02:50 UTC
*** Bug 148421 has been marked as a duplicate of this bug. ***
Comment 4 Jaap A. Haitsma 2004-07-30 06:34:19 UTC
I don't understand why gnome should not do this. For people who use there laptop
in different places with different settings. It would be very helpful if I just
had to change the proxy settings in just one place
Comment 5 Mark McLoughlin 2006-07-13 10:08:22 UTC
It's worth considering this a bit more, I think.

gnome-terminal (see bug #321952) does this, but it would make more sense in gnome-session.
Comment 6 Ray Strode [halfline] 2006-09-06 16:02:30 UTC
Created attachment 72321 [details] [review]
gnome-session-http-proxy.patch

Here's a fairly untested patch to implement this.
Comment 7 Tom Tromey 2006-10-08 20:23:10 UTC
This patch is shipping in FC6, fwiw.

While I'm a bit skeptical about whether this is best done
in gnome-session, I also don't think it will cause big problems.
I suppose we'd have to rethink if there were a large number of
variables we'd want to handle this way, or if we ran into some
unforseen failure mode.

Meanwhile I don't see any reason to keep this out.

Comment 8 Mark McLoughlin 2006-10-26 09:32:08 UTC
See:

  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=212319

for one bug.

Ray: if you move the code into gsm-proxy.[ch], fix the bug above, then I think it's good to commit to HEAD

(I'd prefer the notify handler to not re-read all the keys, but it's not a big deal)
Comment 9 Ray Strode [halfline] 2006-10-27 01:23:31 UTC
Created attachment 75483 [details] [review]
move code to gsm-proxy.[ch]

I committed the above patch which has the changes you mentioned.  I didn't change the way the notify handler reads its keys, because the gconf client
apis already do caching of values in watched gconf directories.

2006-10-26  Ray Strode  <rstrode@redhat.com>

        Set http_proxy environment variable based on GNOME settings
        for legacy apps (bug 84315).

        * Makefile.am: add gsm-proxy.c and gsm-proxy.h
        * gsm-proxy.[ch] (gsm_set_up_legacy_proxy_environment):
        new file to contain function for monitoring GNOME proxy
        settings.
        * headers.h: add #defines for gconf keys to proxy
        settings
        (edit_session_name): Connect to entry's activate signal.
        * main.c (main): call gsm_set_up_legacy_proxy_environment
Comment 10 Brian J. Murrell 2006-11-23 16:22:31 UTC
A couple of problems:

a) Did anyone at all consider the security implications of this?  This moves a
   user's (possibly SSO) password out of the gconf database right into their
   environment.  This may seem like not such a big deal since the password is
   accessible in the gconf database for anyone sitting down at somebody else's
   workstation, but the gconf database is not usually a part of automated bug
   report data gathering.  Frequently the user's environment is.  So users will
   be sending their proxy and/or whole network SSO credentials in bug reports to
   public bug tracking systems.

b) The implementation is wrong:

http_proxy = g_strdup_printf ("http://%s%s%s%s%s:%d",
                           user_name != NULL? user_name : "",
                           user_name != NULL && password != NULL? "@" : "",
                           user_name != NULL && password != NULL? password : "",
                           user_name != NULL? ":" : "",
                           host, port); 

    The format is http://user_name:password@host:port, not
    http://user_name@password:host:port.

Did anyone test or even review this code before committing it?  It simply could not have worked -- unless the proxy server it was tested against is/was broken.

Can we please pay attention to item (a) though before working on (b)?  This is a serious security issue.
Comment 11 Ray Strode [halfline] 2006-11-27 04:17:43 UTC
Created attachment 77190 [details] [review]
committed change that swaps @ and : in http_proxy variable

So that's pretty embarrassing.  I should have spent more time testing the patch before committing it; sorry about that.

As far as the security concerns go I would say that storing the password in GConf is on the same level as storing it in the environment.  If the http proxy password is something that can be considered security-sensitive, then we should be keeping it in the default keyring and shouldn't be setting http_proxy if use_authentication is set.
Comment 12 Ray Strode [halfline] 2006-11-27 05:01:59 UTC
Created attachment 77193 [details] [review]
don't set http_proxy if user's proxy requires authentication

I've committed the above, which just disables the feature in the authenticated proxy case.

There are already other cases where we don't set the variable (like proxy auto configuration), so I think it's probably okay not to set it in this case either.
Comment 13 Ray Strode [halfline] 2006-11-27 05:08:01 UTC
I've filed bug 379687 to address the proxy-password-getting-stored-gconf problem.
Comment 14 Brian J. Murrell 2007-01-06 14:58:19 UTC
(In reply to comment #12)
> Created an attachment (id=77193) [edit]
> don't set http_proxy if user's proxy requires authentication
> 
> I've committed the above, which just disables the feature in the authenticated
> proxy case.

In what version of gnome-session should this (have) show(ed) up?  I am running 2.17.3 and I am still seeing my username/password in the http_proxy variable in my environment.