Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 298310 - SELinux problem when creating manifest
Summary: SELinux problem when creating manifest
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 302803
  Show dependency tree
 
Reported: 2009-12-25 12:53 UTC by Artur Maciag
Modified: 2010-01-29 21:34 UTC (History)
0 users

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


Attachments
fix portage._selinux attribute for reload(portage) (selinux_reload.patch,556 bytes, patch)
2010-01-04 18:41 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Artur Maciag 2009-12-25 12:53:52 UTC
When I try to create manifest I get error:
# ebuild package-9999.ebuild manifest
Appending /usr/local/portage to PORDIR_OVERLAY...
Traceback (most recent call list):
 FIle "/usr/bin/ebuild", line 134, in <module>
  del portage.portdb.porttrees[1:]
 File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 23, in __getattribute__
  result = object.__getattribute__(self, '_get_target')()
 File "/usr/lib64/portage/pym/portage/__init__.py", line 9241, in _get_target
  init_legacy_globals()
 File "/usr/lib64/portage/pym/portage/__init__.py", line 9334, in init_legacy_globals
  selinux_enabled = settings.selinux_enabled()
 File "/usr/lib64/portage/pym/portage/__init__.py", line 3805, in selinux_enabled
  if selinux.is_selinux_enabled() == 1:
 File "/usr/lib64/portage/pym/portage/__init__.py", line 252, in __getattribute__
  result = getattr(object.__getattribute__(self, '_mod'), attr)
AttributeError: 'NoneType' object has no attribute 'is_selinux_enabled'

Reproducible: Always

Steps to Reproduce:
1.create ebuild in local overlay
2.run 'ebuild package-9999 manifest'
3.

Actual Results:  
AttributeError: 'NoneType' object has no attribute 'is_selinux_enabled'

Expected Results:  
Manifest file

# emerge --info
Portage 2.2_rc61 (selinux/2007.0/amd64, gcc-4.4.2, glibc-2.11-r1, 2.6.31-gentoo-r6 x86_64)
=================================================================
System uname: Linux-2.6.31-gentoo-r6-x86_64-Intel-R-_Core-TM-_i5_CPU_750_@_2.67GHz-with-gentoo-2.0.1
Timestamp of tree: Thu, 24 Dec 2009 23:15:01 +0000
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4
dev-python/pycrypto: 2.1.0
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.3
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.64
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages loadpolicy news parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.prz.rzeszow.pl"
LANG="pl_PL.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="pl en"
MAKEOPTS="-j5"
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/x11 /usr/local/portage/layman/je_fro"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="7zip X accessibility acpi alsa amd64 apache2 aspnet2 avahi beagle berkdb bluetooth branding bzip2 cairo cdr cdrom cdrtools cli consolekit cracklib crypt cups cxx dbus dhcpcd dri dvb dvd dvdr dvdread exif expat fam firefox fortran fuse gajim gedit gimp git gnome gnome-keyring gnutls gsm gtk gtk2 hal iconv ieee1394 imap ipv6 j2k jabber java jingle jpeg lirc liv4l2 lzo mmx mmx2 modules mono moonlight mozbranding mpd mudflap mysql nas nautilus ncurses networkmanager nls nptl nptlonly nsplugin nss objc objc++ opengl openmp oss pam pcre pdf perl policykit postgres ppds pppd pulseaudio python qt3support qt4 readline reflection rtsp ruby samba scanner sdl selinux session slang spl sse sse2 ssh ssl subversion svg symlink tcpd tetex tga threads tiff timidity tlen unicode upnp utf8 v4l v4l2 vcd wma xattr xcb xforms xorg xprint xsl xulrunner zeroconf zlib" ALSA_CARDS="hda-intel" 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 authn_alias authn_anon 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 deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" DVB_CARDS="usb-dib0700" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl en" LIRC_DEVICES="pctv" RUBY_TARGETS="ruby18" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="fglrx" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Zac Medico gentoo-dev 2009-12-25 19:55:13 UTC
It seems like portage.selinux failed to initialize for some reason. Please try this as the same user that you used to run the ebuild command:

 python -c 'import portage; print portage.selinux.is_selinux_enabled()'

Does that produce a similar error? What user did you use? Does it happen for all users including root?
Comment 2 Artur Maciag 2009-12-27 06:48:12 UTC
I use root. Non-root returns the same. Command:

# python -c 'import portage; print portage.selinux.is_selinux_enabled()'

returns "0" without error.
Comment 3 Zac Medico gentoo-dev 2010-01-04 18:41:11 UTC
Created attachment 215191 [details, diff]
fix portage._selinux attribute for reload(portage)

Save as /tmp/selinux_reload.patch and apply as follows:

  patch /usr/lib/portage/pym/portage/__init__.py /tmp/selinux_reload.patch
Comment 4 Artur Maciag 2010-01-06 14:49:07 UTC
Thanks. Finally works good.
Comment 5 Zac Medico gentoo-dev 2010-01-29 21:34:00 UTC
This is fixed in 2.1.7.17 and 2.2_rc62.