Subject: console-screen.sh will grep noise instead of vars
Package: console-tools
Version: 1:0.2.3dbs-60
Severity: normal

The section quoted below from console-screeen.sh has the expression for
getting the LANG, LC_ALL and LC_TYPE too permissive:

    if [ -f /etc/environment ]
    then
         for var in LANG LC_ALL LC_CTYPE ; do
             value=$(egrep "^[^#]*${var}=" /etc/environment | tail -n1
| cut -d= -f2)
             eval $var=$value
         done
    fi

This would allow getting a wrong value from an expression like:

jfhgdsdhjskfLANG=fr_FR.UTF-8

in a section like the following:

LANG=ro_RO.UTF-8
jfhgdsdhjskfLANG=fr_FR.UTF-8


It should be written as below (see the egrep line):

value=$(egrep "^\s*${var}=" /etc/environment | tail -n1 | cut -d= -f2)

While we're at it, I think that the LANG value and all the others should
be taken from a distinct file like /etc/default/i18n instead of
/etc/environment (there was a good reasoning behind this in a gdm bug
report). The idea is that /etc/environment should not be used by daemons
and similar, but that should be taken from a different place.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-merci
Locale: LANG=ro_RO.UTF-8, LC_CTYPE=ro_RO.UTF-8 (charmap=UTF-8)

Versions of packages console-tools depends on:
ii  console-common             0.7.56        Basic infrastructure for text cons
ii  debconf [debconf-2.0]      1.4.72        Debian configuration management sy
ii  libc6                      2.3.6-7       GNU C Library: Shared libraries
ii  libconsole                 1:0.2.3dbs-60 Shared libraries for Linux console
ii  sysvinit                   2.86.ds1-14   System-V-like init utilities

Versions of packages console-tools recommends:
ii  console-data                  20060317   Keymaps, fonts, charset maps, fall

-- no debconf information

--
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein

Reply via email to