← Back to team overview

debcrafters-packages team mailing list archive

[Bug 2125808] Re: /usr/sbin/update-info-dir from ubuntu package "install-info" sources /etc/environment, which is not a shell script

 

** Changed in: texinfo (Debian)
       Status: Unknown => New

-- 
You received this bug notification because you are a member of
Debcrafters packages, which is subscribed to texinfo in Ubuntu.
https://bugs.launchpad.net/bugs/2125808

Title:
  /usr/sbin/update-info-dir from ubuntu package "install-info" sources
  /etc/environment, which is not a shell script

Status in texinfo package in Ubuntu:
  Triaged
Status in texinfo package in Debian:
  New

Bug description:
  Reported by a partner:

  In our Ubuntu containers (with our own minimal container runtime), we
  are often hitting an issue like this when installing packages:

  Setting up install-info (7.1-3build2) ...
  /usr/sbin/update-info-dir: 3: /etc/environment: cannot open 536: No such file
  dpkg: error processing package install-info (--configure):
   installed install-info package post-installation script subprocess returned error exit status 2
  Errors were encountered while processing:
   install-info
  E: Sub-process /usr/bin/dpkg returned an error code (1)

  The reason is that our container runtime enroot writes the environment variables from the docker image to /etc/environment, and it uses the simple format KEY=VAL, without any quoting of any kind.
  But "update-info-dir" does the following:

  set -e

  #
  # since user's environment is taken over into root account when sudo-ing
  # we don't want that one's user LANGUAGE setting changes the messages in
  # the dir file. Unset LANGUAGE and reload /etc/environment to get
  # the system wide settings. See bug #536476
  unset LANGUAGE
  unset LANG
  if [ -r /etc/environment ] ; then
    . /etc/environment
  fi
  if [ -r /etc/default/locale ] ; then
    . /etc/default/locale
  fi

  It's hard to be 100% sure given that /etc/environment is not
  standardized, but overall it does not seem like this file was designed
  to be interpreted by a shell.

  From man 8 pam_env:

  Second a file (/etc/environment by default) with simple KEY=VAL pairs
  on separate lines will be read.

  From the IBM AIX documentation (trying to find a reference that likely
  hasn't changed in a while):
  https://www.ibm.com/docs/en/aix/7.1.0?topic=files-environment-file

  Ensure that the information in the environment file is in the
  Name=Value format. Unlike profile scripts, the environment file is not
  a shell script and does not accept data in any format other than the
  Name=Value format.

  Thus I think that sourcing /etc/environment is incorrect in package
  install-info.

  You can find a few other Ubuntu users that stumbled into the same bug:
  https://askubuntu.com/questions/920055/errors-were-encountered-while-processing-install-info

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/texinfo/+bug/2125808/+subscriptions



References