Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 592810 - =sys-apps/policycoreutils-2.5 semanage broken
Summary: =sys-apps/policycoreutils-2.5 semanage broken
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-03 15:06 UTC by jack_mort
Modified: 2016-12-12 14:04 UTC (History)
2 users (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 jack_mort 2016-09-03 15:06:10 UTC
Hi, 

Since upgrade to selinux 2.5 components, I've several issues. 
Here is the one concerning semanage. 

With python 3. 4 :

gateway ~ # semanage
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/semanage", line 27, in <module>
    import seobject
  File "/usr/lib64/python3.4/site-packages/seobject.py", line 347
    print "\n%-25s %-9s %s\n" % (_("Module Name"), _("Priority"), _("Language"))
                            ^
SyntaxError: invalid syntax

With python 2.7 :

gateway ~ # semanage
ERROR: policydb version 30 does not match my version range 15-29
ERROR: Unable to open policy //etc/selinux/strict/policy/policy.30.
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/semanage", line 27, in <module>
    import seobject
  File "/usr/lib64/python2.7/site-packages/seobject.py", line 36, in <module>    import sepolicy
  File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 802, in <module>
    raise e
ValueError: Échec lors de la lecture du fichier stratégie //etc/selinux/strict/policy/policy.30

gateway ~ # emerge --info
Portage 2.3.0 (python 3.4.5-final-0, hardened/linux/amd64/selinux, gcc-5.4.0, glibc-2.23-r2, 4.7.2-hardened x86_64)
=================================================================
System uname: Linux-4.7.2-hardened-x86_64-Intel-R-_Atom-TM-_CPU_C2550_@_2.40GHz-with-gentoo-2.3
KiB Mem:     4019116 total,   1578268 free
KiB Swap:     153596 total,    153596 free
Timestamp of repository gentoo: Sat, 03 Sep 2016 14:00:01 +0000
sh bash 4.3_p46
ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
ccache version 3.2.7 [enabled]
app-shells/bash:          4.3_p46::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/ccache:          3.2.7::gentoo
dev-util/cmake:           3.6.1-r1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.21.7::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.69-r2::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26.1::gentoo
sys-devel/gcc:            5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 Oracle-BCLA-JavaSE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="fr_FR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl acpi amd64 apache2 audit bzip2 caps ccache cli cracklib crypt cxx device-mapper geoip gnutls hardened headless headless-awt iconv imap jpeg justify libav logrotate maildir mmx mmxext modules multilib mysql mysqli ncurses nls nptl open_perms openmp pam pax_kernel pcre peer_perms php pie png readline samba seccomp selinux session smp snmp spamassassin spell sse sse2 ssl ssp syslog tcpd threads truetype ubac unconfined unicode urandom usb vhosts xattr xinetd xml xtpax zlib" ABI_X86="32 64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="access actions alias auth_basic auth_digest authn_anon authn_core authn_dbd authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi compat dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif slotmem_shm so socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" L10N="fr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-0" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.4"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jason Zaman gentoo-dev 2016-09-30 10:29:36 UTC
The python3.4 problem is fixed in the git tree. I was going to backport the fixes but there is going to be a release candidate today so no point in backporting.

the python2.7 problem can be fixed by setting
policy-version = 29
in /etc/selinux/semanage.conf
then do:
semodule -B
rm /etc/selinux/*/policy/policy.30

When you later have >=setools-4 and >=libsemanage-2.6* installed you can remove that policy-version line and delete the policy.29 file instead and use policy version 30.
Hopefully RC1 of the selinux userland tools will be released on the weekend and I'll add them to the tree then you can test.
Comment 2 Jason Zaman gentoo-dev 2016-10-04 15:44:18 UTC
2.6_rc1 is in the tree now, want to give it a shot?
you can also remove the policy-version=29 from your semanage.conf now
Comment 3 Jason Zaman gentoo-dev 2016-12-12 14:04:36 UTC
2.6 is stable