Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 262136 - sys-apps/policycoreutils: semanage IndexError: list index out of range
Summary: sys-apps/policycoreutils: semanage IndexError: list index out of range
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: SE Linux Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-11 14:12 UTC by montjoie
Modified: 2011-06-03 08:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description montjoie 2009-03-11 14:12:08 UTC
When i type semanage with or without arguments i obtain:
# semanage            
Traceback (most recent call last):
  File "/usr/sbin/semanage", line 24, in <module>
    import seobject
  File "//usr/lib/python2.5/site-packages/seobject.py", line 32, in <module>
    gettext.install(PROGNAME, localedir="/usr/share/locale", unicode=1)
  File "/usr/lib/python2.5/gettext.py", line 493, in install
    t = translation(domain, localedir, fallback=True, codeset=codeset)
  File "/usr/lib/python2.5/gettext.py", line 478, in translation
    t = _translations.setdefault(key, class_(open(mofile, 'rb')))
  File "/usr/lib/python2.5/gettext.py", line 180, in __init__
    self._parse(fp)
  File "/usr/lib/python2.5/gettext.py", line 314, in _parse
    plural = v[1].split('plural=')[1]
IndexError: list index out of range


Reproducible: Always

Steps to Reproduce:
1. install a fresh gentoo selinux profile
2. type semanage
3.

Actual Results:  
Traceback (most recent call last):
  File "/usr/sbin/semanage", line 24, in <module>
    import seobject
  File "//usr/lib/python2.5/site-packages/seobject.py", line 32, in <module>
    gettext.install(PROGNAME, localedir="/usr/share/locale", unicode=1)
  File "/usr/lib/python2.5/gettext.py", line 493, in install
    t = translation(domain, localedir, fallback=True, codeset=codeset)
  File "/usr/lib/python2.5/gettext.py", line 478, in translation
    t = _translations.setdefault(key, class_(open(mofile, 'rb')))
  File "/usr/lib/python2.5/gettext.py", line 180, in __init__
    self._parse(fp)
  File "/usr/lib/python2.5/gettext.py", line 314, in _parse
    plural = v[1].split('plural=')[1]
IndexError: list index out of range

Expected Results:  
semanage normal result or help for semanage

Portage 2.1.6.7 (selinux/2007.0/x86/hardened, gcc-4.1.2, glibc-2.8_p20080602-r1, 2.6.27-gentoo-r8 i686)
=================================================================
System uname: Linux-2.6.27-gentoo-r8-i686-AMD_Athlon-tm-_64_Processor_3200+-with-glibc2.0
Timestamp of tree: Wed, 11 Mar 2009 08:00:01 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.5.2-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i486-pc-linux-gnu"
CFLAGS="-O2 -march=athlon64 -pipe"
CHOST="i486-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=athlon64 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages loadpolicy parallel-fetch protect-owned sandbox selinux sesandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="fr_FR@euro"
LC_ALL="fr_FR@euro"
LDFLAGS=""
LINGUAS="fr"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X aalib acpi alsa apache2 audit berkdb bzip2 cli cracklib crypt dri firefox gnome gpm gtk hardened iconv isdnlog java5 jpeg kqemu libcaca libnotify lm_sensors lzma midi mmx mmxext mudflap ncurses nls nptl nptlonly opengl pam pcre perl pic png pppd readline reflection restrict-javascript samba sdl selinux session slang spell spl sse sse2 ssl svg tcpd tiff unicode win32codecs x86 xext xorg xulrunner xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 	emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m 	maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" USERLAND="GNU" VIDEO_CARDS="radeon vesa fglrx"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 montjoie 2009-03-11 14:38:49 UTC
same thing with sys-apps/policycoreutils-2.0.55
semanage      
Traceback (most recent call last):
  File "/usr/sbin/semanage", line 24, in <module>
    import seobject
  File "//usr/lib/python2.5/site-packages/seobject.py", line 34, in <module>
    gettext.install(PROGNAME, localedir="/usr/share/locale", unicode=1)
  File "/usr/lib/python2.5/gettext.py", line 493, in install
    t = translation(domain, localedir, fallback=True, codeset=codeset)
  File "/usr/lib/python2.5/gettext.py", line 478, in translation
    t = _translations.setdefault(key, class_(open(mofile, 'rb')))
  File "/usr/lib/python2.5/gettext.py", line 180, in __init__
    self._parse(fp)
  File "/usr/lib/python2.5/gettext.py", line 314, in _parse
    plural = v[1].split('plural=')[1]
IndexError: list index out of range
Comment 2 montjoie 2009-03-17 12:21:40 UTC
With this locale it's work:
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=


Comment 3 Sven Vermeulen 2011-04-17 12:16:44 UTC
monjoie

Do you still have this problem currently (I know, there's lots of time between the reporting date and now ;)? The selinux utilities have been updated as well as the SELinux profiles.
Comment 4 montjoie 2011-04-18 12:57:25 UTC
I still have the problem and the "fix" to use POSIX locale still works

xxx@xxxx:~/$ locale
LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=
xxxx@xxx:~/$ /usr/sbin/semanage 
Traceback (most recent call last):
  File "/usr/sbin/semanage", line 24, in <module>
    import seobject
  File "/usr/lib/python2.6/site-packages/seobject.py", line 34, in <module>
    gettext.install(PROGNAME, localedir="/usr/share/locale", unicode=1)
  File "/usr/lib/python2.6/gettext.py", line 493, in install
    t = translation(domain, localedir, fallback=True, codeset=codeset)
  File "/usr/lib/python2.6/gettext.py", line 478, in translation
    t = _translations.setdefault(key, class_(open(mofile, 'rb')))
  File "/usr/lib/python2.6/gettext.py", line 180, in __init__
    self._parse(fp)
  File "/usr/lib/python2.6/gettext.py", line 314, in _parse
    plural = v[1].split('plural=')[1]
IndexError: list index out of range
Comment 5 Sven Vermeulen 2011-04-20 18:59:03 UTC
Might be a long shot, but is gettext installed?
Comment 6 montjoie 2011-05-30 15:15:48 UTC
yes gettext is installed
With the latest selinux ebuild, the issue disappear.
But now i got
semanage
Execution of 'eselect python show --python2' failed

And got theses AVC
#============= semanage_t ==============
allow semanage_t self:fifo_file { read write };
allow semanage_t shell_exec_t:file execute;

But it will be another bug report.
Comment 7 Anthony Basile gentoo-dev 2011-06-03 08:59:05 UTC
Looks like the original issues was fixed with 2.20101213 policies.  Please reopen if this particular issue resurfaces, and we'll address the avc in your next bug report.