Skip to contentSkip to conversation

libselinux: get pywrap depends on selinux.py

PATCH Applied [email protected] 2 participants 2 messages Aug 14, 2015 – Aug 25, 2015 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libselinux: get pywrap depends on selinux.py

From: Wenzong Fan <[email protected]>

The selinux.py is generated at compile-time and will be installed as python module "selinux/__init__.py", just make sure that it has been generated completely while starting "make install-pywrap".

This fixes below errors that caused by an empty "selinux/__init__.py":

  $ /usr/sbin/semanage -h

Traceback (most recent call last):
File "/usr/sbin/semanage", line 30, in <module>
import seobject
File "/usr/lib64/python2.7/site-packages/seobject.py", line 27, in <module>
import sepolicy
File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 226, in <module>
def get_file_equiv_modified(fc_path = selinux.selinux_file_context_path()):
AttributeError: 'module' object has no attribute 'selinux_file_context_path'

---
 libselinux/src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libselinux/src/Makefile +1 -1
index ac25c1f..a81acc7 100644
@@ -90,7 +90,7 @@ SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./
 
 all: $(LIBA) $(LIBSO) $(LIBPC)
 
-pywrap: all $(SWIGSO) $(AUDIT2WHYSO)
+pywrap: all $(SWIGFILES) $(AUDIT2WHYSO)
 
 rubywrap: all $(SWIGRUBYSO)
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 29 lines · On 08/14/2015 04:08 AM, [email protected] wrote:

From: Wenzong Fan <[email protected]>

The selinux.py is generated at compile-time and will be installed as python module "selinux/__init__.py", just make sure that it has been generated completely while starting "make install-pywrap".

This fixes below errors that caused by an empty "selinux/__init__.py":

  $ /usr/sbin/semanage -h

Traceback (most recent call last):
File "/usr/sbin/semanage", line 30, in <module>
import seobject
File "/usr/lib64/python2.7/site-packages/seobject.py", line 27, in <module>
import sepolicy
File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 226, in <module>
def get_file_equiv_modified(fc_path = selinux.selinux_file_context_path()):
AttributeError: 'module' object has no attribute 'selinux_file_context_path'

---
 libselinux/src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libselinux/src/Makefile +0 -0
index ac25c1f..a81acc7 100644

libselinux/src/Makefile SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ · line 95

Quoted 7 lines
libselinux/src/Makefile +1 -1
@@ -90,7 +90,7 @@ SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./
 
 all: $(LIBA) $(LIBSO) $(LIBPC)
 
-pywrap: all $(SWIGSO) $(AUDIT2WHYSO)
+pywrap: all $(SWIGFILES) $(AUDIT2WHYSO)
 
 rubywrap: all $(SWIGRUBYSO)

Thanks, applied.