From patchwork Sat Nov 5 21:24:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Iooss X-Patchwork-Id: 9413819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1393C6022E for ; Sat, 5 Nov 2016 21:24:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04CB4296A9 for ; Sat, 5 Nov 2016 21:24:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED84A296AE; Sat, 5 Nov 2016 21:24:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from emsm-gh1-uea11.nsa.gov (smtp.nsa.gov [8.44.101.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3C27B296A9 for ; Sat, 5 Nov 2016 21:24:32 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.31,450,1473120000"; d="scan'208";a="528771" IronPort-PHdr: =?us-ascii?q?9a23=3AaB/L/RCCQDewTuNCybJGUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSP7+pMbcNUDSrc9gkEXOFd2CrakV0ayH6uu5BTdIyK3CmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBy?= =?us-ascii?q?brysXNWD1YLmjqvrp8abSj4LrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYe?= =?us-ascii?q?VcyDAgD1uSmxHh+pX4p8Y7oGxtofZpy+psGeW/Jvx5HvRkC2E9PmQ04tD7nQXS?= =?us-ascii?q?RguIoH0HWyMZlQQbLRLC6UTcX5z2tiLh/st63zKBdZnwTLszXT25qaZsTwTzoC?= =?us-ascii?q?JbJ3g+6m6B2Z84t75SvB/0/083+IXTeozAcaMmcw=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2GSJABnTR5Y/wHyM5BcHQEFAQsBGQYMgwMBAQEBAR9YfKY?= =?us-ascii?q?6AY4JhkQnA4F4GoV8UwEBAQEBAQEBAgECXyiCMwQDEwV5W0MCNxQgDgMJAhcpC?= =?us-ascii?q?AgDAS0VHwsFGASINwQBsxs4AoNnh0iGPoYjgksRAWiFFAWIRYdMihaBa4RKgwu?= =?us-ascii?q?GeYJHgTOGHoYDSZBnVVYNMoNKgUZxhRd4gTUBAQE?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP; 05 Nov 2016 21:24:31 +0000 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 uA5LOHvc004764; Sat, 5 Nov 2016 17:24:20 -0400 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 uA5LOF8W167508 for ; Sat, 5 Nov 2016 17:24:15 -0400 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 uA5LOFVD004762 for ; Sat, 5 Nov 2016 17:24:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1B8AAAvTR5YhyIeaIFcHgYMgy4BAQEBAXd8tESCNoQwCIIShXxTAQIBAQEBAQITAQEBCgsJCR2HYohYBAGgYJI6hCGHSIY+hiODRYUUBYhFh0yKFoFrhEqDC4Z5gkeBM4whSZBngTiCdgELAXmBRnGHRAEBAQ X-IPAS-Result: A1B8AAAvTR5YhyIeaIFcHgYMgy4BAQEBAXd8tESCNoQwCIIShXxTAQIBAQEBAQITAQEBCgsJCR2HYohYBAGgYJI6hCGHSIY+hiODRYUUBYhFh0yKFoFrhEqDC4Z5gkeBM4whSZBngTiCdgELAXmBRnGHRAEBAQ X-IronPort-AV: E=Sophos;i="5.31,450,1473134400"; d="scan'208";a="5806719" Received: from emsm-gh1-uea10.corp.nsa.gov (HELO emsm-gh1-uea10.nsa.gov) ([10.208.41.36]) by goalie.tycho.ncsc.mil with ESMTP; 05 Nov 2016 17:24:15 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AntJwyB0zkgKb9x0CsmDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?segVIvad9pjvdHbS+e9qxAeQG96KsbQV0qGP7/uocFdDyK7JiGoFfp1IWk1Nou?= =?us-ascii?q?QttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIs?= =?us-ascii?q?YL+kQMiD1o/ui7v60qaQSj0AvCC6b7J2IUf+hiTqne5Sv7FfLL0swADCuHpCdr?= =?us-ascii?q?ce72ppIVWOg0S0vZ/or9YwuxhX7uks889GTLXSY7UzTbseCi8vdW8y+p7Frx7G?= =?us-ascii?q?GC2O7XwYW35esx1PGBONuBf7VZD1uzC8t+16wzKyOJHmC7cuVmLxvO9QVBb0hX?= =?us-ascii?q?JfZHYC+2bNh5kogQ=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0FMBACbTR5YhyIeaIFcHgYMGQYMgwMBA?= =?us-ascii?q?QEBAXd8pjuOCYI2hDAIgXgahXxTAQEBAQEBAQECAQIQAQEBCgsJCR0wgjMYgQB?= =?us-ascii?q?bgwyIWAQBoGGSOoQhh0iGPoYjg0WFFAWIRYdMihaBa4RKgwuGeYJHgTOMIUmQZ?= =?us-ascii?q?4E4gnYBCwF5gUZxh0QBAQE?= X-IPAS-Result: =?us-ascii?q?A0FMBACbTR5YhyIeaIFcHgYMGQYMgwMBAQEBAXd8pjuOCYI?= =?us-ascii?q?2hDAIgXgahXxTAQEBAQEBAQECAQIQAQEBCgsJCR0wgjMYgQBbgwyIWAQBoGGSO?= =?us-ascii?q?oQhh0iGPoYjg0WFFAWIRYdMihaBa4RKgwuGeYJHgTOMIUmQZ4E4gnYBCwF5gUZ?= =?us-ascii?q?xh0QBAQE?= X-IronPort-AV: E=Sophos;i="5.31,450,1473120000"; d="scan'208";a="652685" Received: from mx1.polytechnique.org ([129.104.30.34]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2016 21:24:14 +0000 Received: from localhost.localdomain (32.206.133.77.rev.sfr.net [77.133.206.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 7C57F5648C1 for ; Sat, 5 Nov 2016 22:24:13 +0100 (CET) From: Nicolas Iooss To: selinux@tycho.nsa.gov Subject: [PATCH 1/1] libselinux, libsemanage: remove *swig_python_exception.i if its creation failed Date: Sat, 5 Nov 2016 22:24:03 +0100 Message-Id: <20161105212403.30462-1-nicolas.iooss@m4x.org> X-Mailer: git-send-email 2.10.2 X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Sat Nov 5 22:24:13 2016 +0100 (CET)) X-Org-Mail: nicolas.iooss.2010@polytechnique.org 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-Virus-Scanned: ClamAV using ClamSMTP When compiling libselinux with CC=clang, "make pywrap" reports the following message: bash exception.sh > selinuxswig_python_exception.i clang-3.9: error: no such file or directory: 'temp.aux' awk: fatal: cannot open file `temp.aux' for reading (No such file or directory) This does not make the build fail as exception.sh returns an "OK" status. Use "bash -e" with this script to make it return an error value. In order not to keep an empty selinuxswig_python_exception.i file after a build fails (which would make a second run of "make pywrap" incorrectly succeed), remove the file when exception.sh fails. As libsemanage uses the same code to build semanageswig_python_exception.i, modify its Makefile too. By the way, on Linux clang does not seem to currently support -aux-info so it cannot be used to craft selinuxswig_python_exception.i. Signed-off-by: Nicolas Iooss --- libselinux/src/Makefile | 2 +- libsemanage/src/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index b92fe1c8f5f9..24946cee8a01 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -140,7 +140,7 @@ $(LIBPC): $(LIBPC).in ../VERSION sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@ selinuxswig_python_exception.i: ../include/selinux/selinux.h - bash exception.sh > $@ + bash -e exception.sh > $@ || (rm -f $@ ; false) $(AUDIT2WHYLOBJ): audit2why.c $(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $< diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile index 55e3f469b0ba..cd29a8abf5ab 100644 --- a/libsemanage/src/Makefile +++ b/libsemanage/src/Makefile @@ -98,7 +98,7 @@ $(LIBPC): $(LIBPC).in ../VERSION sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@ semanageswig_python_exception.i: ../include/semanage/semanage.h - bash exception.sh > $@ + bash -e exception.sh > $@ || (rm -f $@ ; false) conf-scan.c: conf-scan.l conf-parse.h $(LEX) $(LFLAGS) -t $< > $@