Bug 186054

Summary: yum doesn't use proxy when launched from sudo context
Product: [Fedora] Fedora Reporter: stef <stephane.tranchemer>
Component: yumAssignee: Jeremy Katz <katzj>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: katzj
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-04-19 20:41:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description stef 2006-03-21 12:37:23 UTC
Description of problem:

when you run  a yum command like 'sudo yum upgrade' or 'sudo yum install <package>' , it doesn't 
work.

doing a 'export http_proxy=http://proxy:8080' or adding the line 'proxy=http://proxy:8080' in /etc/
yum.conf doesn't change a thing.

works only if yum is started from a real root console.

Version-Release number of selected component (if applicable):


How reproducible:

always

Steps to Reproduce:
1.be a user declared in the sudoers 
2.launch 'sudo yum upgrade'
3.
  
Actual results:

yum fails to find the repositories

Expected results:

yum working

Additional info:

Comment 1 stef 2006-03-21 13:06:04 UTC
additional infos :

even launched from a root console (after doing a 'su' or 'su -'), you still need
to enter   'export http_proxy=http://proxy:8080' before issuing the 'yum
upgrade' command.

The parameter 'proxy=http://proxy:8080' in /etc/yum.conf is ignored.

Comment 2 Jeremy Katz 2006-03-21 15:04:52 UTC
By default, sudo now does some environment cleaning and only retains a certain
set of env vars to avoid the never-ending exploits due to preserved
environmental variables.  See /etc/sudoers for the list of what's kept.

proxy in yum.conf should work though

Comment 3 stef 2006-03-22 09:53:19 UTC
(In reply to comment #2)
> proxy in yum.conf should work though

Well it doesn't ...

here's an example output, the line 'proxy=http://proxy:8080' is present in
/etc/yum.conf.

[root@yuri ~]# yum upgrade
Loading "installonlyn" plugin
Setting up Upgrade Process
Setting up repositories
livna                                                                [1/4]
core                                                                 [2/4]
Cannot find a valid baseurl for repo: core
Error: Cannot find a valid baseurl for repo: core

[root@yuri ~]# export HTTP_PROXY=http://proxy:8080

[root@yuri ~]# yum upgrade
Loading "installonlyn" plugin
Setting up Upgrade Process
Setting up repositories
livna                                                                [1/4]
core                                                                 [2/4]
updates                                                              [3/4]
extras                                                               [4/4]
Reading repository metadata in from local files
No Packages marked for Update/Obsoletion


Comment 4 stef 2006-03-22 09:56:24 UTC
(In reply to comment #2)
> By default, sudo now does some environment cleaning and only retains a certain
> set of env vars to avoid the never-ending exploits due to preserved
> environmental variables.  See /etc/sudoers for the list of what's kept.

to be complete, the result as shown in comment #3 is ALSO true when running yum
from a real root login, not only a 'sudo' or a 'su'.


Comment 5 Jeremy Katz 2006-04-19 20:41:48 UTC

*** This bug has been marked as a duplicate of 185309 ***