Package: lsb-release
Version: 3.2-4ubuntu1
Severity: important
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 lsb_release crashes if /etc/debian_version and/or /etc/lsb-release have
wrong permissions because Python IOError exceptions are not expected
over open() functions.
Here is a really simple patch to properly catch the exceptions.

Best regards,
Carl Chenet


- -- System Information:
Debian Release: lenny/sid
  APT prefers hardy-updates
  APT policy: (500, 'hardy-updates'), (500, 'hardy-security'), (500, 'hardy')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-23-generic (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lsb-release depends on:
ii  python                    2.5.2-0ubuntu1 An interactive high-level object-o

Versions of packages lsb-release recommends:
ii  apt                      0.7.9ubuntu17.1 Advanced front-end for dpkg

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJzR4q8lge+lYYJUgRAvKqAJ4qTgnq0WRkia0S+jrSPTJ/lkOpNQCfQFt8
2G0QuP9ekXr8hBI2JZBbzfw=
=lpkT
-----END PGP SIGNATURE-----
188c188,191
<         release = open('/etc/debian_version').read().strip()
---
>         try:
>             release = open('/etc/debian_version').read().strip()
>         except IOError, msg:
>             print msg
234,246c237,252
<         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
---
>         try:
>             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
>         except IOError, msg:
>             print msg

Reply via email to