semanage crashes

Alle weiteren Dienste, die nicht in die drei oberen Foren gehören.
Antworten
RobinG
Beiträge: 1
Registriert: 09.01.2018 14:29:06

semanage crashes

Beitrag von RobinG » 09.01.2018 14:32:26

Hello,

I'm trying to change some selinux settings with 'semanage'. But the program crashes. For example a call to

Code: Alles auswählen

semanage --version
results in the error:

Code: Alles auswählen

  File "/usr/sbin/semanage", line 28, in <module>
    import seobject
  File "/usr/lib/python3/dist-packages/seobject.py", line 34, in <module>
    import sepolicy
  File "/usr/lib/python3/dist-packages/sepolicy/__init__.py", line 8, in <module>
    import setools
  File "/usr/lib/python3/dist-packages/setools/__init__.py", line 74, in <module>
    from .infoflow import InfoFlowAnalysis
  File "/usr/lib/python3/dist-packages/setools/infoflow.py", line 22, in <module>
    import networkx as nx
  File "/usr/lib/python3/dist-packages/networkx/__init__.py", line 93, in <module>
    import networkx.linalg
  File "/usr/lib/python3/dist-packages/networkx/linalg/__init__.py", line 9, in <module>
    from networkx.linalg.algebraicconnectivity import *
  File "/usr/lib/python3/dist-packages/networkx/linalg/algebraicconnectivity.py", line 18, in <module>
    from numpy import (array, asmatrix, asarray, dot, matrix, ndarray, ones,
  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 142, in <module>
    from . import add_newdocs
  File "/usr/lib/python3/dist-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/usr/lib/python3/dist-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 33, in <module>
    from . import _internal  # for freeze programs
  File "/usr/lib/python3/dist-packages/numpy/core/_internal.py", line 14, in <module>
    import ctypes
  File "/usr/lib/python3.5/ctypes/__init__.py", line 537, in <module>
    _reset_cache()
  File "/usr/lib/python3.5/ctypes/__init__.py", line 276, in _reset_cache
    CFUNCTYPE(c_int)(lambda: None)
MemoryError
Debian Stretch / Kernel 4.9.0-4-amd64

Thank you for your help.
Robin

rendegast
Beiträge: 14938
Registriert: 27.02.2006 16:50:33
Lizenz eigener Beiträge: MIT Lizenz

Re: semanage crashes

Beitrag von rendegast » 21.01.2018 09:37:47

Code: Alles auswählen

# aptitude  install policycoreutils-python-utils --without-recommends -y
The following NEW packages will be installed:
  checkpolicy{a} [2.6-2]  libauparse0{a} [1:2.6.7-2]  policycoreutils{a} [2.6-3]  policycoreutils-python-utils [2.6-3]  python3-audit{a} [1:2.6.7-2]  
  python3-decorator{a} [4.0.11-1]  python3-ipy{a} [1:0.83-1]  python3-networkx{a} [1.11-2]  python3-selinux{a} [2.6-3+b3]  python3-semanage{a} [2.6-2]  
  python3-sepolgen{a} [2.6-3]  python3-sepolicy{a} [2.6-3]  python3-setools{a} [4.0.1-6]  selinux-utils{a} [2.6-3+b3]  
The following packages are RECOMMENDED but will NOT be installed:
  python3-numpy  python3-scipy  python3-yaml  selinux-policy-dev  
0 packages upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/2,358 kB of archives. After unpacking 12.7 MB will be used.
.....


# semanage --version
Traceback (most recent call last):
  File "/usr/sbin/semanage", line 28, in <module>
    import seobject
  File "/usr/lib/python3/dist-packages/seobject.py", line 1038, in <module>
    class portRecords(semanageRecords):
  File "/usr/lib/python3/dist-packages/seobject.py", line 1040, in portRecords
    valid_types = list(list(sepolicy.info(sepolicy.ATTRIBUTE, "port_type"))[0]["types"])
  File "/usr/lib/python3/dist-packages/sepolicy/__init__.py", line 192, in <genexpr>
    return ({
  File "/usr/lib/python3/dist-packages/setools/typeattrquery.py", line 65, in results
    for attr in self.policy.typeattributes():
AttributeError: 'NoneType' object has no attribute 'typeattributes'


# semanage --help
Traceback (most recent call last):
  File "/usr/sbin/semanage", line 28, in <module>
    import seobject
  File "/usr/lib/python3/dist-packages/seobject.py", line 1038, in <module>
    class portRecords(semanageRecords):
  File "/usr/lib/python3/dist-packages/seobject.py", line 1040, in portRecords
    valid_types = list(list(sepolicy.info(sepolicy.ATTRIBUTE, "port_type"))[0]["types"])
  File "/usr/lib/python3/dist-packages/sepolicy/__init__.py", line 192, in <genexpr>
    return ({
  File "/usr/lib/python3/dist-packages/setools/typeattrquery.py", line 65, in results
    for attr in self.policy.typeattributes():
AttributeError: 'NoneType' object has no attribute 'typeattributes'
dito mit zBsp. 'semanage login -h'.
Muß selinux vielleicht aktiv laufen? Selbst für die profane Versions-/Hilfe-Ausgabe?


kernel 4.14.13 und libreoffice aus stretch-backports, darunter nur python3-uno mit python-Bezug.
python2.7-minimal und python3.5-minimal


Ein einziger archivierter Bug in
https://bugs.debian.org/policycoreutils-python-utils,
der mit 2.6-1 -> 2.6-2 geschlossen wurde.
mfg rendegast
-----------------------
Viel Eifer, viel Irrtum; weniger Eifer, weniger Irrtum; kein Eifer, kein Irrtum.
(Lin Yutang "Moment in Peking")

Benutzeravatar
TRex
Moderator
Beiträge: 6079
Registriert: 23.11.2006 12:23:54
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: KA

Re: semanage crashes

Beitrag von TRex » 21.01.2018 10:54:37

Auf launchpad gibts auch nen bug: https://bugs.launchpad.net/ubuntu/+sour ... ug/1713419

Ich blick da nur nicht ganz durch, auf welche Version sich das bezieht. Vermutlich 2.7.1.
Jesus saves. Buddha does incremental backups.
Windows ist doof, Linux funktioniert nichtDon't break debian!

Antworten