Skip to contentSkip to conversation

libselinux: Don't wrap rpm_execcon with DISABLE_RPM

PATCH Applied Petr Lautrbach 2 participants 2 messages Dec 10, 2015 – Dec 17, 2015 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libselinux: Don't wrap rpm_execcon with DISABLE_RPM

a2737333 commit introduced a possibility to build libselinux without rpm_execcon() when DISABLE_RPM is set. However, it didn't cover SWIG bindings. With this commit the rpm_execcon() bindings are not created.

Fixes:
ImportError: /usr/lib64/python3.5/site-packages/selinux/_selinux.so: undefined symbol: rpm_execcon

---
 libselinux/include/selinux/selinux.h | 2 ++
 libselinux/src/Makefile              | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
libselinux/include/selinux/selinux.h +2 -0
index 4beb170..2262086 100644
@@ -601,10 +601,12 @@ void fini_selinuxmnt(void);
  * program, falling back to a new context with the specified type. */
 extern int setexecfilecon(const char *filename, const char *fallback_type);
 
+#ifndef DISABLE_RPM
 /* Execute a helper for rpm in an appropriate security context. */
 extern int rpm_execcon(unsigned int verified,
 		       const char *filename,
 		       char *const argv[], char *const envp[]);
+#endif
 
 /* Returns whether a file context is customizable, and should not 
    be relabeled . */
libselinux/src/Makefile +2 -2
index feab561..79d50d2 100644
@@ -85,9 +85,9 @@ ifneq (,$(filter i386,$(ARCH)))
 TLSFLAGS += -mno-tls-direct-seg-refs
 endif
 
-SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
+SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./ $(EMFLAGS)
 
-SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./
+SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(EMFLAGS)
 
 all: $(LIBA) $(LIBSO) $(LIBPC)
 
Signature · 1 line
2.6.3
#1 lore raw
Quoted 7 lines · Petr Lautrbach

a2737333 commit introduced a possibility to build libselinux without rpm_execcon() when DISABLE_RPM is set. However, it didn't cover SWIG bindings. With this commit the rpm_execcon() bindings are not created.

Fixes:
ImportError: /usr/lib64/python3.5/site-packages/selinux/_selinux.so: undefined symbol: rpm_execcon

Applied. Thanks.

Quoted 39 lines
---
 libselinux/include/selinux/selinux.h | 2 ++
 libselinux/src/Makefile              | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
libselinux/include/selinux/selinux.h +2 -0
index 4beb170..2262086 100644
@@ -601,10 +601,12 @@ void fini_selinuxmnt(void);
  * program, falling back to a new context with the specified type. */
 extern int setexecfilecon(const char *filename, const char *fallback_type);
 
+#ifndef DISABLE_RPM
 /* Execute a helper for rpm in an appropriate security context. */
 extern int rpm_execcon(unsigned int verified,
 		       const char *filename,
 		       char *const argv[], char *const envp[]);
+#endif
 
 /* Returns whether a file context is customizable, and should not 
    be relabeled . */
libselinux/src/Makefile +2 -2
index feab561..79d50d2 100644
@@ -85,9 +85,9 @@ ifneq (,$(filter i386,$(ARCH)))
 TLSFLAGS += -mno-tls-direct-seg-refs
 endif
 
-SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
+SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./ $(EMFLAGS)
 
-SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./
+SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(EMFLAGS)
 
 all: $(LIBA) $(LIBSO) $(LIBPC)