All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libselinux: Don't wrap rpm_execcon with DISABLE_RPM
@ 2015-12-10 17:27 Petr Lautrbach
  2015-12-17 14:18 ` Steve Lawrence
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Lautrbach @ 2015-12-10 17:27 UTC (permalink / raw)
  To: selinux

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
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 libselinux/include/selinux/selinux.h | 2 ++
 libselinux/src/Makefile              | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libselinux/include/selinux/selinux.h b/libselinux/include/selinux/selinux.h
index 4beb170..2262086 100644
--- a/libselinux/include/selinux/selinux.h
+++ b/libselinux/include/selinux/selinux.h
@@ -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 . */
diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index feab561..79d50d2 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -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)
 
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libselinux: Don't wrap rpm_execcon with DISABLE_RPM
  2015-12-10 17:27 [PATCH] libselinux: Don't wrap rpm_execcon with DISABLE_RPM Petr Lautrbach
@ 2015-12-17 14:18 ` Steve Lawrence
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Lawrence @ 2015-12-17 14:18 UTC (permalink / raw)
  To: Petr Lautrbach, selinux

On 12/10/2015 12:27 PM, Petr Lautrbach wrote:
> 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
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>

Applied. Thanks.

> ---
>  libselinux/include/selinux/selinux.h | 2 ++
>  libselinux/src/Makefile              | 4 ++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libselinux/include/selinux/selinux.h b/libselinux/include/selinux/selinux.h
> index 4beb170..2262086 100644
> --- a/libselinux/include/selinux/selinux.h
> +++ b/libselinux/include/selinux/selinux.h
> @@ -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 . */
> diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
> index feab561..79d50d2 100644
> --- a/libselinux/src/Makefile
> +++ b/libselinux/src/Makefile
> @@ -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)
>  
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-17 14:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-10 17:27 [PATCH] libselinux: Don't wrap rpm_execcon with DISABLE_RPM Petr Lautrbach
2015-12-17 14:18 ` Steve Lawrence

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.