Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 336350 - New 2.1 and 2.2 portages have broken SELinux support
Summary: New 2.1 and 2.2 portages have broken SELinux support
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks: 335925
  Show dependency tree
 
Reported: 2010-09-07 13:21 UTC by Chris PeBenito (RETIRED)
Modified: 2010-09-08 22:24 UTC (History)
0 users

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


Attachments
Patch for portage._selinux (portage-selinux.patch,344 bytes, patch)
2010-09-07 14:20 UTC, Arfrever Frehtes Taifersar Arahesis (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris PeBenito (RETIRED) gentoo-dev 2010-09-07 13:21:29 UTC
Both 2.1.9 and 2.2 (around rc73 or 74) a change to the SELinux code in portage was made and it breaks portage in SELinux.  They both get a missing attribute is_selinux_enabled:

gorn portage # emerge -u dos2unix
FEATURES variable contains unknown value(s): loadpolicy
Calculating dependencies... done!

>>> Emerging (1 of 1) app-text/dos2unix-5.1.1
Traceback (most recent call last):
  File "/usr/bin/emerge", line 43, in <module>
    retval = emerge_main()
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1678, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 436, in action_build
    retval = mergetask.merge()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1081, in merge
    rval = self._merge()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1397, in _merge
    self._main_loop()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1537, in _main_loop
    while self._schedule():
  File "/usr/lib64/portage/pym/_emerge/PollScheduler.py", line 52, in _schedule
    return self._schedule_tasks()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1573, in _schedule_tasks
    if q.schedule():
  File "/usr/lib64/portage/pym/_emerge/SequentialTaskQueue.py", line 55, in schedule
    task.start()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 23, in start
    self._start()
  File "/usr/lib64/portage/pym/_emerge/MergeListItem.py", line 90, in _start
    self._start_task(build, self._default_final_exit)
  File "/usr/lib64/portage/pym/_emerge/CompositeTask.py", line 118, in _start_task
    task.start()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 23, in start
    self._start()
  File "/usr/lib64/portage/pym/_emerge/EbuildBuild.py", line 81, in _start
    self._prefetch_exit(prefetcher)
  File "/usr/lib64/portage/pym/_emerge/EbuildBuild.py", line 131, in _prefetch_exit
    self._start_task(pre_clean_phase, self._pre_clean_exit)
  File "/usr/lib64/portage/pym/_emerge/CompositeTask.py", line 118, in _start_task
    task.start()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 23, in start
    self._start()
  File "/usr/lib64/portage/pym/_emerge/EbuildPhase.py", line 67, in _start
    self._start_ebuild()
  File "/usr/lib64/portage/pym/_emerge/EbuildPhase.py", line 90, in _start_ebuild
    self._start_task(ebuild_process, self._ebuild_exit)
  File "/usr/lib64/portage/pym/_emerge/CompositeTask.py", line 118, in _start_task
    task.start()
  File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 23, in start
    self._start()
  File "/usr/lib64/portage/pym/_emerge/AbstractEbuildProcess.py", line 90, in _start
    SpawnProcess._start(self)
  File "/usr/lib64/portage/pym/_emerge/SpawnProcess.py", line 62, in _start
    if self._can_log(slave_fd):
  File "/usr/lib64/portage/pym/_emerge/AbstractEbuildProcess.py", line 172, in _can_log
    and self.settings.selinux_enabled()) or os.isatty(slave_fd)
  File "/usr/lib64/portage/pym/portage/package/ebuild/config.py", line 2202, in selinux_enabled
    if selinux.is_selinux_enabled() == 1:
  File "/usr/lib64/portage/pym/portage/__init__.py", line 270, in __getattribute__
    result = getattr(object.__getattribute__(self, '_mod'), attr)
AttributeError: 'module' object has no attribute 'is_selinux_enabled'

in both 2.1 and 2.2, the following line needs to be added on line 16 of _selinux.py in portage:

from selinux import is_selinux_enabled
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-09-07 14:20:18 UTC
Created attachment 246362 [details, diff]
Patch for portage._selinux

'from selinux import is_selinux_enabled' would cause pylint's warning about unused import. Please test this patch.
Comment 2 Zac Medico gentoo-dev 2010-09-07 15:43:38 UTC
(In reply to comment #1)
> Created an attachment (id=246362) [details]
> Patch for portage._selinux

Thanks, this is in git now:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=62f8d9c4f3e8c87d17145b9b508843a6eef80b9c
Comment 3 Zac Medico gentoo-dev 2010-09-08 22:24:58 UTC
This is fixed in 2.1.9.2 and 2.2_rc78.