From patchwork Mon Oct 17 20:24:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Roberts, William C" X-Patchwork-Id: 9380513 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 DB853600CA for ; Mon, 17 Oct 2016 20:29:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D028B28F34 for ; Mon, 17 Oct 2016 20:29:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C533328F4D; Mon, 17 Oct 2016 20:29:32 +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 (emsm-gh1-uea11.nsa.gov [8.44.101.9]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D17A28F34 for ; Mon, 17 Oct 2016 20:29:32 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.31,358,1473120000"; d="scan'208";a="20138023" IronPort-PHdr: =?us-ascii?q?9a23=3ABkH8WhF4H2crNU+Eln/YJ51GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ75rs6wAkXT6L1XgUPTWs2DsrQf2rCQ7vqrADdRqb+681k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZv?= =?us-ascii?q?IaytQ8iJ3p7xirr5osaCKyxzxxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP?= =?us-ascii?q?5Xz247bXianhL7+9vitMU7q3cYhuglv/Jkfe26Ov1gDO8QMDNzKG0x5cv2pTHf?= =?us-ascii?q?XACP4T0aSWxQnR1WR0De4Rj8Uo32sye/sutmxAGGLMb2SvYyQj3k4KB1DFfzhD?= =?us-ascii?q?wvKy8y8GaRjNd5yq1cvkGPvRt6lpHVZIWUPf84deXHetkXX3ZadsdXSyFFRIi7?= =?us-ascii?q?athcR9EdNPpV+tGu72AFqgGzUEz1XO4=3D?= X-IPAS-Result: =?us-ascii?q?A2GwBgAtNAVY/wHyM5BbGwEBAQMBAQEJAQEBFwEBBAEBCgE?= =?us-ascii?q?BgxEBAQEBAR2BU6Q6gVuUWyeHdEwBAQEBAQEBAQIBAlsngjIEAxMFghECBAECJ?= =?us-ascii?q?BMUIA4DCQEBFwghCAgDAS0VEQcHCwUYBIgxwlYmiEKGaREBhXsFmgaQBAKJfoV?= =?us-ascii?q?1SZAyVIVbVgGGYHiBKAEBAQ?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP; 17 Oct 2016 20:29:07 +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 u9HKT5JV001173; Mon, 17 Oct 2016 16:29:06 -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 u9HKOvLg165467 for ; Mon, 17 Oct 2016 16:24:57 -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 u9HKOuRZ032743; Mon, 17 Oct 2016 16:24:56 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1AhBAC1MgVY/yNjr8ZbGgEBAQECAQEBAQgBAQEBgzwBAQEBAR2BU6Q6kimEF4YiAoFtTAECAQEBAQECXoUJAgQnUhAgMVcHEohSwkgBAQEHKIhCjHYFmgaQBAKPc0mQMlSFWyI0AYkAAQEB X-IPAS-Result: A1AhBAC1MgVY/yNjr8ZbGgEBAQECAQEBAQgBAQEBgzwBAQEBAR2BU6Q6kimEF4YiAoFtTAECAQEBAQECXoUJAgQnUhAgMVcHEohSwkgBAQEHKIhCjHYFmgaQBAKPc0mQMlSFWyI0AYkAAQEB X-IronPort-AV: E=Sophos;i="5.31,358,1473134400"; d="scan'208";a="5767607" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 17 Oct 2016 16:24:56 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AIAA+kBW6VINiX4v8jumeCHOxUzjV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYZxWAt8tkgFKBZ4jH8fUM07OQ6PG6HzFaqs/a4TgrS99lb1c9k8?= =?us-ascii?q?IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9?= =?us-ascii?q?HOnpAIma153xjLHovcCJKFwT1XKUWvBbFF2OtwLft80b08NJC50a7V/3mEZOYP?= =?us-ascii?q?lc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4gyLE?= =?us-ascii?q?VxeC6kERWWQOyFIIX1CEv1nGWcLqvy/7sPdt8DWLNs3xC7YvUHKt6LkvAATlgS?= =?us-ascii?q?ELLTk4/CTTi9dspL5KqxKm4RpkysjbZ5/RfOFyZYvBbNgaQixHRc8XWCtfUa2m?= =?us-ascii?q?aI5aEOsFOedRqs/24UEJpxakGRKEBeXzxzsOjXjzjv5y6PgoDQyThF9oJNkJqn?= =?us-ascii?q?mB6YutOQ=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0G1BQAxMwVY/yNjr8ZbGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFgEBAQMBAQEJAQEBgxEBAQEBAR2BU6Q6gVuQToQXhiICgW1MAQEBAQE?= =?us-ascii?q?BAQECAQJbJ4IyBAEVBYIRAgQnUhAgMVcHEohSwkgBAQEHAgEliEKMdgWaBpAEA?= =?us-ascii?q?o9zSZAyVIVbIjQBhz+BQQEBAQ?= X-IPAS-Result: =?us-ascii?q?A0G1BQAxMwVY/yNjr8ZbGgEBAQECAQEBAQgBAQEBFgEBAQM?= =?us-ascii?q?BAQEJAQEBgxEBAQEBAR2BU6Q6gVuQToQXhiICgW1MAQEBAQEBAQECAQJbJ4IyB?= =?us-ascii?q?AEVBYIRAgQnUhAgMVcHEohSwkgBAQEHAgEliEKMdgWaBpAEAo9zSZAyVIVbIjQ?= =?us-ascii?q?Bhz+BQQEBAQ?= X-IronPort-AV: E=Sophos;i="5.31,358,1473120000"; d="scan'208";a="20137877" Received: from fmsmga002-icc.fm.intel.com ([198.175.99.35]) by emsm-gh1-uea11.nsa.gov with ESMTP; 17 Oct 2016 20:24:52 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga002-icc.fm.intel.com with ESMTP; 17 Oct 2016 13:24:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.31,358,1473145200"; d="scan'208"; a="1046007579" Received: from mcohen2-mobl.amr.corp.intel.com (HELO wcrobert-MOBL1.amr.corp.intel.com) ([10.254.186.130]) by orsmga001.jf.intel.com with ESMTP; 17 Oct 2016 13:24:51 -0700 From: william.c.roberts@intel.com To: selinux@tycho.nsa.gov, seandroid-list@tycho.nsa.gov, sds@tycho.nsa.gov Subject: [PATCH 7/8] libselinux: DISABLE_BOOL move to include headers Date: Mon, 17 Oct 2016 16:24:09 -0400 Message-Id: <1476735850-7844-7-git-send-email-william.c.roberts@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476735850-7844-1-git-send-email-william.c.roberts@intel.com> References: <1476735850-7844-1-git-send-email-william.c.roberts@intel.com> 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 From: William Roberts Some systems, like Mac, don't have stdio_ext.h. Since we're building with DISABLE_BOOL=y on Mac, just include the header files with the DISABLE define, and use the bare minimum headers for DISABLE_BOOL=y. Signed-off-by: William Roberts --- libselinux/src/booleans.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libselinux/src/booleans.c b/libselinux/src/booleans.c index cbb0610..ba9d934 100644 --- a/libselinux/src/booleans.c +++ b/libselinux/src/booleans.c @@ -5,6 +5,8 @@ * Dan Walsh - Added security_load_booleans(). */ +#ifndef DISABLE_BOOL + #include #include #include @@ -25,8 +27,6 @@ #define SELINUX_BOOL_DIR "/booleans/" -#ifndef DISABLE_BOOL - static int filename_select(const struct dirent *d) { if (d->d_name[0] == '.' @@ -561,6 +561,10 @@ int security_load_booleans(char *path) } #else + +#include +#include "selinux_internal.h" + int security_set_boolean_list(size_t boolcnt __attribute__((unused)), SELboolean * boollist __attribute__((unused)), int permanent __attribute__((unused)))