Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 285592 - setfscreatecon() error with FEATURES="selinux"
Summary: setfscreatecon() error with FEATURES="selinux"
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks:
 
Reported: 2009-09-19 16:04 UTC by Michael Edenfield
Modified: 2009-10-19 13:02 UTC (History)
0 users

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 Michael Edenfield 2009-09-19 16:04:40 UTC
Attempting to merge any packages using the latest portage with SELinux enabled causes an error in setfscreatecon().  This is being generated by the exception handler in _selinux.mkdir():

    selinux.setfscreatecon(ctx)
    try:
        os.mkdir(target)
    finally:
        selinux.setfscreatecon()

Explicitly passing None in the final call:

        selinux.setfscreatecon(None)

seems to get rid of the crash and seems to be what was intended.

Reproducible: Always

Steps to Reproduce:
1. emerge any package with an SELinux profile selected.
2.
3.

Actual Results:  
Portage fails on the final merge into the live system with the following error:

  File "/usr/lib/portage/pym/portage/_selinux.py", line 50, in mkdir
    selinux.setfscreatecon()
TypeError: setfscreatecon() takes exactly 1 argument (0 given)

Expected Results:  
Package should merge successfully.

emerge --info:
Portage 2.2_rc40 (selinux/2007.0/x86/hardened, gcc-4.3.4, glibc-2.10.1-r0, 2.6.29-hardened-apollo-4 i686)
=================================================================
System uname: Linux-2.6.29-hardened-apollo-4-i686-Intel-R-_Pentium-R-_4_CPU_1.80GHz-with-gentoo-2.0.1
Timestamp of tree: Fri, 18 Sep 2009 22:45:03 +0000
app-shells/bash:     4.0_p33
dev-lang/python:     2.6.2-r1, 3.1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.0
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium4 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages loadpolicy metadata-transfer parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
GENTOO_MIRRORS="ftp://ftp.is.co.za/mirror/gentoo.org/"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
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/layman/sunrise /usr/local/portage/layman/hardened-development"
SYNC="rsync://ftp.is.co.za/gentoo-portage"
USE="X ads apache2 bash-completion bzip2 cli consolekit cracklib crypt cups dbus dri gnome hal hardened iconv isdnlog kerberos ldap mudflap mysql ncurses nls openmp pam pcre perl php pic pppd python readline reflection selinux session spl ssl svg tcpd threads unicode vim-syntax winbind x86 xml xorg zlib" APACHE2_MODULES="actions alias auth_basic authn_default authn_file authz_default authz_groupfile authz_host authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires file_cache filter headers imagemap log_config logio mem_cache mime mime_magic negotiation rewrite setenvif so userdir" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" USERLAND="GNU" VIDEO_CARDS="savage"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Zac Medico gentoo-dev 2009-09-19 17:12:28 UTC
This is fixed in svn:
 http://sources.gentoo.org/viewcvs.py/portage?rev=14161&view=rev
Comment 2 Zac Medico gentoo-dev 2009-10-14 19:26:36 UTC
This is fixed in portage-2.2_rc41.
Comment 3 Brent Baude (RETIRED) gentoo-dev 2009-10-19 13:02:28 UTC
ppc64 done