[Bug 982684] Re: sudo, pkexec don't apply global environment settings from /etc/environment

pdecat 982684 at bugs.launchpad.net
Fri Aug 24 10:35:52 UTC 2012


This bug was causing the following error with flashplugin-installer:

$ sudo apt-get --reinstall install flashplugin-installer
[sudo] password for pdecat:
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
0 mis à jour, 0 nouvellement installés, 1 réinstallés, 0 à enlever et 5 non mis à jour.
Il est nécessaire de prendre 0 o/8 076 o dans les archives.
Après cette opération, 0 o d'espace disque supplémentaires seront utilisés.
Préconfiguration des paquets...
(Lecture de la base de données... 266104 fichiers et répertoires déjà installés.)
Préparation du remplacement de flashplugin-installer 11.2.202.238ubuntu0.12.04.1 (en utilisant .../flashplugin-installer_11.2.202.238ubuntu0.12.04.1_amd64.deb) ...
Dépaquetage de la mise à jour de flashplugin-installer ...
Traitement des actions différées (« triggers ») pour « update-notifier-common »...
flashplugin-installer: downloading http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_11.2.202.238.orig.tar.gz
Traceback (most recent call last):
  File "/usr/lib/update-notifier/package-data-downloader", line 234, in process_download_requests
    dest_file = urllib.urlretrieve(files[i])[0]
  File "/usr/lib/python2.7/urllib.py", line 93, in urlretrieve
    return _urlopener.retrieve(url, filename, reporthook, data)
  File "/usr/lib/python2.7/urllib.py", line 239, in retrieve
    fp = self.open(url, data)
  File "/usr/lib/python2.7/urllib.py", line 207, in open
    return getattr(self, name)(url)
  File "/usr/lib/python2.7/urllib.py", line 344, in open_http
    h.endheaders(data)
  File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 776, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 757, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
IOError: [Errno socket error] [Errno 110] Connection timed out
Paramétrage de flashplugin-installer (11.2.202.238ubuntu0.12.04.1) ...

Fixed by forcing sudo-1.8.3p1-1ubuntu3.3 installation from precise-
updates as precise-security has higher priority:

$ apt-cache policy sudo-1.8.3p1-1ubuntu3.3
sudo:
  Installé : 1.8.3p1-1ubuntu3.2
  Candidat : 1.8.3p1-1ubuntu3.2
 Table de version :
     1.8.3p1-1ubuntu3.3 0
        900 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
 *** 1.8.3p1-1ubuntu3.2 0
        990 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.8.3p1-1ubuntu3 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

$ sudo aptitude install sudo/precise-updates

$ apt-cache policy sudo 
sudo:
  Installé : 1.8.3p1-1ubuntu3.3
  Candidat : 1.8.3p1-1ubuntu3.3
 Table de version :
 *** 1.8.3p1-1ubuntu3.3 0
        900 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.8.3p1-1ubuntu3.2 0
        990 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     1.8.3p1-1ubuntu3 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

$ sudo apt-get --reinstall install flashplugin-installer
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
0 mis à jour, 0 nouvellement installés, 1 réinstallés, 0 à enlever et 5 non mis à jour.
Il est nécessaire de prendre 0 o/8 076 o dans les archives.
Après cette opération, 0 o d'espace disque supplémentaires seront utilisés.
Préconfiguration des paquets...
(Lecture de la base de données... 266104 fichiers et répertoires déjà installés.)
Préparation du remplacement de flashplugin-installer 11.2.202.238ubuntu0.12.04.1 (en utilisant .../flashplugin-installer_11.2.202.238ubuntu0.12.04.1_amd64.deb) ...
Dépaquetage de la mise à jour de flashplugin-installer ...
Traitement des actions différées (« triggers ») pour « update-notifier-common »...
flashplugin-installer: downloading http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_11.2.202.238.orig.tar.gz
Installing from local file /tmp/tmpwIYlxU.gz
Flash Plugin installed.
Paramétrage de flashplugin-installer (11.2.202.238ubuntu0.12.04.1) ...

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to sudo in Ubuntu.
https://bugs.launchpad.net/bugs/982684

Title:
  sudo, pkexec don't apply global environment settings from
  /etc/environment

Status in “policykit-1” package in Ubuntu:
  Fix Released
Status in “sudo” package in Ubuntu:
  Fix Released
Status in “policykit-1” source package in Precise:
  Fix Released
Status in “sudo” source package in Precise:
  Fix Released
Status in “policykit-1” source package in Quantal:
  Fix Released
Status in “sudo” source package in Quantal:
  Fix Released

Bug description:
  [Impact]
  In connection with the recent update-notifier changes (https://wiki.ubuntu.com/Specs/UpdateNotifierPackageDataDownloader), some users who were previously able to download the flashplugin via the apt proxy settings are now unable to download it when running, e.g., 'sudo apt-get install'.

  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/locale) via pam_env.

  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=invalid' in /etc/environment
  2. Run 'sudo wget http://www.ubuntu.com/', 'pkexec wget http://www.ubuntu.com/'
  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
  ProcVersionSignature: Ubuntu 3.2.0-22.35-generic 3.2.14
  Uname: Linux 3.2.0-22-generic x86_64
  ApportVersion: 2.0.1-0ubuntu3
  Architecture: amd64
  CheckboxSubmission: 017452a27eca3c8b498abbfa5ef91db9
  CheckboxSystem: ecaaad6fa1e0799a0aa1126bf620f39e
  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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/policykit-1/+bug/982684/+subscriptions




More information about the foundations-bugs mailing list