From patchwork Thu Dec 10 17:27:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Lautrbach X-Patchwork-Id: 7820901 Return-Path: X-Original-To: patchwork-selinux@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D407D9F3E6 for ; Thu, 10 Dec 2015 17:34:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2B8DA205BE for ; Thu, 10 Dec 2015 17:34:17 +0000 (UTC) Received: from emvm-gh1-uea08.nsa.gov (emvm-gh1-uea08.nsa.gov [63.239.67.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4281F20524 for ; Thu, 10 Dec 2015 17:34:16 +0000 (UTC) X-TM-IMSS-Message-ID: <4ced8bce0006146f@nsa.gov> Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by nsa.gov ([10.208.42.193]) with ESMTP (TREND IMSS SMTP Service 7.1) id 4ced8bce0006146f ; Thu, 10 Dec 2015 12:31:44 -0500 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id tBAHS6LU019659; Thu, 10 Dec 2015 12:28:20 -0500 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id tBAHS2cI010572 for ; Thu, 10 Dec 2015 12:28:02 -0500 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id tBAHS2Q4019654 for ; Thu, 10 Dec 2015 12:28:02 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1D/AAB0tWlWnBy3hNFeGQEBAhABAgKEIyatcAGNMYQJhg+CBgEBAQEBARIBAQEBAQgLCQkhhWKBHjOIL8EFhlaKJIQZBZZvjUOOc0WNUYItRxYHgVc9NIVaAQEB X-IPAS-Result: A1D/AAB0tWlWnBy3hNFeGQEBAhABAgKEIyatcAGNMYQJhg+CBgEBAQEBARIBAQEBAQgLCQkhhWKBHjOIL8EFhlaKJIQZBZZvjUOOc0WNUYItRxYHgVc9NIVaAQEB X-IronPort-AV: E=Sophos;i="5.20,409,1444708800"; d="scan'208";a="5016192" Received: from emvm-gh1-uea08.nsa.gov ([10.208.42.193]) by goalie.tycho.ncsc.mil with ESMTP; 10 Dec 2015 12:27:59 -0500 X-TM-IMSS-Message-ID: <4ce9f51b00061276@nsa.gov> Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by nsa.gov ([10.208.42.193]) with ESMTP (TREND IMSS SMTP Service 7.1; TLSv1/SSLv3 ADH-AES256-SHA (256/256)) id 4ce9f51b00061276 ; Thu, 10 Dec 2015 12:27:49 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id BC7E28C1A5 for ; Thu, 10 Dec 2015 17:27:56 +0000 (UTC) Received: from hulk.com (ovpn-204-42.brq.redhat.com [10.40.204.42]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBAHRsnX007628; Thu, 10 Dec 2015 12:27:55 -0500 From: Petr Lautrbach To: selinux@tycho.nsa.gov Subject: [PATCH] libselinux: Don't wrap rpm_execcon with DISABLE_RPM Date: Thu, 10 Dec 2015 18:27:48 +0100 Message-Id: <1449768468-16765-1-git-send-email-plautrba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-TM-AS-MML: disable X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)