sudo, pkexec don't apply global environment settings from /etc/environment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PolicyKit |
Fix Released
|
Medium
|
|||
policykit-1 (Ubuntu) |
Fix Released
|
Medium
|
Steve Langasek | ||
Precise |
Fix Released
|
Medium
|
Steve Langasek | ||
Quantal |
Fix Released
|
Medium
|
Steve Langasek | ||
sudo (Ubuntu) |
Fix Released
|
Medium
|
Tyler Hicks | ||
Precise |
Fix Released
|
Medium
|
Steve Langasek | ||
Quantal |
Fix Released
|
Medium
|
Tyler Hicks |
Bug Description
[Impact]
In connection with the recent update-notifier changes (https:/
The reason for this is that, even though a global proxy may be configured in /etc/environment, sudo does not allow $http_proxy to be inherited by default and does not reapply the environment from /etc/environment (and from /etc/default/
The first part is reasonable, but I question the second part. Since these are global config files, I believe it's safe for sudo to apply the environment settings by default just as 'su' does; and the settings are intended to apply globally, which would include to sudo sessions.
This would make update-notifier work more reliably for users with proxies, and would probably help with a variety of other cases where global variables are currently not being set as expected for sudo.
[Test Case]
1. Set 'http_proxy=
2. Run 'sudo wget http://
3. Verify that the commands return successfully
4. Install updated sudo, policykit-1 packages from precise-proposed
5. Repeat the commands from step 2
6. Verify that the commands now fail with an error about invalid proxies
7. Remove the http_proxy line from /etc/environment
[Regression potential]
Some users may consider it a feature that global settings from /etc/environment are not applied to sudo and/or pkexec. However, this is not by design; the cost of not being able to correctly support proxies for users is greater than the cost of changing this behavior in an SRU and breaking expectations of users regarding undocumented behavior.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: sudo 1.8.3p1-1ubuntu3
ProcVersionSign
Uname: Linux 3.2.0-22-generic x86_64
ApportVersion: 2.0.1-0ubuntu3
Architecture: amd64
CheckboxSubmission: 017452a27eca3c8
CheckboxSystem: ecaaad6fa1e0799
Date: Sun Apr 15 16:41:17 2012
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
ProcEnviron:
TERM=xterm
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: sudo
UpgradeStatus: Upgraded to precise on 2011-11-08 (159 days ago)
Related branches
Changed in sudo (Ubuntu Precise): | |
importance: | Undecided → Medium |
status: | New → Triaged |
assignee: | nobody → Steve Langasek (vorlon) |
Changed in sudo (Ubuntu Quantal): | |
assignee: | nobody → Steve Langasek (vorlon) |
status: | Triaged → In Progress |
Changed in sudo (Ubuntu Quantal): | |
assignee: | Steve Langasek (vorlon) → Tyler Hicks (tyhicks) |
summary: |
- sudo doesn't apply global environment settings from /etc/environment + sudo, pkexec don't apply global environment settings from + /etc/environment |
Changed in policykit-1 (Ubuntu Precise): | |
status: | New → Triaged |
Changed in policykit-1 (Ubuntu Quantal): | |
status: | New → In Progress |
Changed in policykit-1 (Ubuntu Precise): | |
importance: | Undecided → Medium |
Changed in policykit-1 (Ubuntu Quantal): | |
importance: | Undecided → Medium |
Changed in policykit-1 (Ubuntu Precise): | |
assignee: | nobody → Steve Langasek (vorlon) |
Changed in policykit-1 (Ubuntu Quantal): | |
assignee: | nobody → Steve Langasek (vorlon) |
description: | updated |
Changed in policykit-1 (Ubuntu Precise): | |
status: | Triaged → In Progress |
Changed in policykit: | |
importance: | Unknown → Medium |
status: | Unknown → Incomplete |
Changed in policykit: | |
status: | Incomplete → Fix Released |
I just found another usecase where fixing this issue helps:
sudo apt-add-repository FOO
does not work when http_proxy is required. (As http_proxy from env. is not set and apt's proxy is not used.)