expects to be able to source /etc/lsb-release

Bug #214861 reported by Colin Watson
2
Affects Status Importance Assigned to Milestone
localechooser (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Binary package hint: localechooser

localechooser expects to be able to source the /etc/lsb-release file as shell:

                [ -f /etc/lsb-release ] && . /etc/lsb-release

Strictly speaking, this isn't safe. The code in lsb_release itself that parses /etc/lsb-release is as follows:

        for line in open('/etc/lsb-release'):
            line = line.strip()
            if not line:
                continue
            # Skip invalid lines
            if not '=' in line:
                continue
            var, arg = line.split('=', 1)
            if var.startswith('DISTRIB_'):
                var = var[8:]
                if arg.startswith('"') and arg.endswith('"'):
                    arg = arg[1:-1]
                distinfo[var] = arg

In other words, lsb_release doesn't require values to be double-quoted even if they contain spaces. However, if you create an /etc/lsb-release file with spaces in any of its values and omit the double quotes around it, then localechooser will break.

We should parse this file properly.

Revision history for this message
Colin Watson (cjwatson) wrote :

High because this has been known to break derived distributions and generate support requests.

Changed in localechooser:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package localechooser - 1.42ubuntu5

---------------
localechooser (1.42ubuntu5) hardy; urgency=low

  * Don't assume that /etc/lsb-release is valid shell (LP: #214861).

 -- Colin Watson <email address hidden> Thu, 10 Apr 2008 00:35:24 +0100

Changed in localechooser:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.