From patchwork Mon Nov 18 14:52:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Mosnacek X-Patchwork-Id: 11249839 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C284D13A4 for ; Mon, 18 Nov 2019 14:52:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A133B2084D for ; Mon, 18 Nov 2019 14:52:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="N9wbu47x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727238AbfKROwq (ORCPT ); Mon, 18 Nov 2019 09:52:46 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:40612 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727140AbfKROwq (ORCPT ); Mon, 18 Nov 2019 09:52:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574088764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YA77x+4PA0qaAsOTR4t/Bl4as0UKWpCesCnEV6xwFR0=; b=N9wbu47xNwdg9nnHrQHBeP3a1rXeGYWSXf1KmCHb+oOH/eZGMwx7N3JmtFQ+qGghQbV7LZ hGyj4/88HdtsHr0lduSZQN/mbNvvsGVbFhBjtYrou7z8Y5+ttfXRGKhOI4xNnXIHvAzxMy z7SpCqmb13r7WnIZK412MG3jof8hl1U= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-K_bDYUsMO96ofL3FVYtMaw-1; Mon, 18 Nov 2019 09:52:41 -0500 Received: by mail-wr1-f71.google.com with SMTP id e10so15362928wrt.16 for ; Mon, 18 Nov 2019 06:52:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JdrqQyBgjLnoJVNufGA0KbMbzvfP1CLHphimIOO60r4=; b=Teml4fYprnfFxguwXYYkvkMU3Dan5nUYvw39e41xtq1gBATo5BlELW1+8Ip1DNjUO+ vk2gr97Alsbg9YT3REcR2IgnCfeZ90D6BllhvD4bxrtz6Njjb+F81ZuRdgnd+nBZS5Ab FZY0BeHj7qDEX8S6Z7uzXp2S7gR4draccg0+hDhb4fxOmdSMgD6fTIgrht7Gc5ll/Dzj 87eit4VhzUC0zBcOahBpz/GKXm2iHbiaSUffi53nwcBbGIKbzfF5KAxskCcFbIddoPYm U2fgFeAOASi6kKZBq4cr1DGKbXwaeFm3CO4BVC0ODfpF5IwDcw1xyzsc7NIYr/lm1ers aSzg== X-Gm-Message-State: APjAAAXK8GyENvMoXZeO/W4gPp075Yr3NglIUwmwByYrG/6d6f66c/3P GZAzemqurRYOcM0YQaKYFULiFfQN2GCkH7jIpfOO//h0b/DAFnSd9+54kn1QsoW8X0yeWC7x/Qk zJRuTUixvOiEKcD5SMg== X-Received: by 2002:a1c:6641:: with SMTP id a62mr28836424wmc.54.1574088760039; Mon, 18 Nov 2019 06:52:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzm2USSaAqX1tnWKJ3JeBYVEfQbsfuhq4RIa4doEhCDnPJ7ex30wN6ZgEku/GUroII7h01hrQ== X-Received: by 2002:a1c:6641:: with SMTP id a62mr28836404wmc.54.1574088759790; Mon, 18 Nov 2019 06:52:39 -0800 (PST) Received: from localhost.localdomain.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id o5sm23044658wrx.15.2019.11.18.06.52.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2019 06:52:39 -0800 (PST) From: Ondrej Mosnacek To: selinux@vger.kernel.org Subject: [PATCH testsuite v4 1/3] policy: drop the unneeded userdom_search_generic_user_home_dirs() Date: Mon, 18 Nov 2019 15:52:36 +0100 Message-Id: <20191118145238.408124-2-omosnace@redhat.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191118145238.408124-1-omosnace@redhat.com> References: <20191118145238.408124-1-omosnace@redhat.com> MIME-Version: 1.0 X-MC-Unique: K_bDYUsMO96ofL3FVYtMaw-1 X-Mimecast-Spam-Score: 0 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org userdom_search_generic_user_home_dirs() is not defined in neither Fedora policy nor refpolicy. userdom_search_user_home_dirs() is already defined in both, so just use that directly. Signed-off-by: Ondrej Mosnacek --- policy/test_ipc.te | 2 +- policy/test_policy.if | 6 ------ policy/test_ptrace.te | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/policy/test_ipc.te b/policy/test_ipc.te index baa7bda..324b690 100644 --- a/policy/test_ipc.te +++ b/policy/test_ipc.te @@ -83,4 +83,4 @@ sysadm_bin_spec_domtrans_to(ipcdomain) allow test_ipc_base_t self:sem create_sem_perms; allow test_ipc_base_t self:shm create_shm_perms; # ipcrm needs this... -userdom_search_generic_user_home_dirs(test_ipc_base_t) +userdom_search_user_home_dirs(test_ipc_base_t) diff --git a/policy/test_policy.if b/policy/test_policy.if index 5f4000f..939cd7e 100644 --- a/policy/test_policy.if +++ b/policy/test_policy.if @@ -60,9 +60,3 @@ interface(`userdom_sysadm_entry_spec_domtrans_to',` allow $1 sysadm_t:process sigchld; ') ') - -ifdef(`userdom_search_generic_user_home_dirs', `', ` dnl -interface(`userdom_search_generic_user_home_dirs', ` - userdom_search_user_home_dirs($1) -') -') diff --git a/policy/test_ptrace.te b/policy/test_ptrace.te index 0d10e85..b5f9995 100644 --- a/policy/test_ptrace.te +++ b/policy/test_ptrace.te @@ -34,7 +34,7 @@ allow test_ptrace_traced_t test_file_t:fifo_file rw_file_perms; # Allow the tracer domain to trace the traced domain. allow test_ptrace_tracer_t test_ptrace_traced_t:process ptrace; -userdom_search_generic_user_home_dirs(test_ptrace_traced_t) +userdom_search_user_home_dirs(test_ptrace_traced_t) # Let the tracer wait on the traced domain. allow test_ptrace_traced_t test_ptrace_tracer_t:process sigchld; From patchwork Mon Nov 18 14:52:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Mosnacek X-Patchwork-Id: 11249837 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67F641390 for ; Mon, 18 Nov 2019 14:52:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45F2C2084D for ; Mon, 18 Nov 2019 14:52:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aHBOE56n" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727185AbfKROwp (ORCPT ); Mon, 18 Nov 2019 09:52:45 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:22548 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726748AbfKROwo (ORCPT ); Mon, 18 Nov 2019 09:52:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574088763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DabM93OoheOrEmXg8Syh0emJ+a/qyGvYPkLKHwVWNXY=; b=aHBOE56nn0n9sQap0JxVwmO72epByzpwHyxvjaIZqTjR3JZz/VnbIGTYm6KQDtB50Z60rO CQzWKVLZrV4pMuXA/q1f7kX041t4mBVd4KQy3UUTU0SBsJf9wyDfVkgo8/sdScDm8K9gMW ibp6BLGRwgaeQXMU7Ed4NihbUCaCQqU= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-287-fJIjeJgpO8CuBRKB__YIlA-1; Mon, 18 Nov 2019 09:52:42 -0500 Received: by mail-wr1-f70.google.com with SMTP id l3so15473861wrx.21 for ; Mon, 18 Nov 2019 06:52:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tShv3HblVr38GsmOK3QTPK0EcQKV+tukNGauXiaStiw=; b=s8t+GL61nZTCoLUFDbsBlnyDkGliH1FHAiZvNRI0+ymkhiNzeUF+JSy6Otk0OJ9I2J UJ+oBfSK4AIrdcT5IbcxQZvlq5dBkMikWFUHnFVJdKFc/sqA9lcc3GEhEOcm9UHBVm9G QxdkJa+UJy/b0HDGs+9/NBBQ8562FvI5thzOP/JmdtS48vZ/NTplgUiNmwJYD7texneJ 2liZTjdbIh6kj4iWgaF48bmnkB/BeQ/2dSTUCqQQn6uEfVV1/dSMGEYWj6lQp56EX2Ic ooID6Srpkw+qzQKajLEHxuYpWzQC9/QrZkVh06q//RyIQoDG16sCnFrgUustS8/24a5a CY2Q== X-Gm-Message-State: APjAAAWK9jlc2RYJax8S5/EeGVnXfwDdQH22mip5pR4u1qE54Rkd5Zn5 y1gjAaQcB599FsuuhJGh67jVxzv0F0Aub9DlmPqeD5lAZqsnjAWlADNz4MCULLjZ94EW2B3AuvZ Afre9Say2hfZEr0cLBQ== X-Received: by 2002:adf:978c:: with SMTP id s12mr29733422wrb.47.1574088760786; Mon, 18 Nov 2019 06:52:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwVg6Z6Imu0cyzMhC7Mt7Eo1AAo2oiq/nu0GK1+vnNxECAxpLclsP74A0Piw4OlLHqfU3TcvA== X-Received: by 2002:adf:978c:: with SMTP id s12mr29733405wrb.47.1574088760565; Mon, 18 Nov 2019 06:52:40 -0800 (PST) Received: from localhost.localdomain.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id o5sm23044658wrx.15.2019.11.18.06.52.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2019 06:52:40 -0800 (PST) From: Ondrej Mosnacek To: selinux@vger.kernel.org Subject: [PATCH testsuite v4 2/3] policy: add fallbacks for Fedora-specific macros Date: Mon, 18 Nov 2019 15:52:37 +0100 Message-Id: <20191118145238.408124-3-omosnace@redhat.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191118145238.408124-1-omosnace@redhat.com> References: <20191118145238.408124-1-omosnace@redhat.com> MIME-Version: 1.0 X-MC-Unique: fJIjeJgpO8CuBRKB__YIlA-1 X-Mimecast-Spam-Score: 0 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org dev_rw_infiniband_dev() and mount_rw_pid_files() are not defined in refpolicy. Fall back to dev_rw_generic_{blk|chr}_files() and mount_rw_runtime_files() if they are not defined. Also, userdom_search_admin_dir() is not defined in refpolicy because it doesn't have admin_home_t. Fall back to userdom_search_user_home_content(), which should apply for root's home directory under refpolicy. Signed-off-by: Ondrej Mosnacek --- policy/test_policy.if | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/policy/test_policy.if b/policy/test_policy.if index 939cd7e..e1175e8 100644 --- a/policy/test_policy.if +++ b/policy/test_policy.if @@ -60,3 +60,25 @@ interface(`userdom_sysadm_entry_spec_domtrans_to',` allow $1 sysadm_t:process sigchld; ') ') + +# Workarounds for refpolicy: + +ifdef(`dev_rw_infiniband_dev', `', ` dnl +interface(`dev_rw_infiniband_dev', ` + dev_rw_generic_blk_files($1) + dev_rw_generic_chr_files($1) +') +') + +ifdef(`mount_rw_pid_files', `', ` dnl +interface(`mount_rw_pid_files', ` + mount_rw_runtime_files($1) +') +') + +# Refpolicy doesn't have admin_home_t - assume /root will be user_home_dir_t. +ifdef(`userdom_search_admin_dir', `', ` dnl +interface(`userdom_search_admin_dir', ` + userdom_search_user_home_content($1) +') +') From patchwork Mon Nov 18 14:52:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Mosnacek X-Patchwork-Id: 11249841 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A101013A4 for ; Mon, 18 Nov 2019 14:52:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 76D1A2084D for ; Mon, 18 Nov 2019 14:52:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Zt5raw2h" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727140AbfKROwr (ORCPT ); Mon, 18 Nov 2019 09:52:47 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:35019 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726748AbfKROwr (ORCPT ); Mon, 18 Nov 2019 09:52:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574088765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YynLGcwqfrg1zrZcC7yWAsZBhR/R+Oy3X5+AJIk9Z2o=; b=Zt5raw2hvd+ijlBjfOV1Qp3N5WqA0sjyOFuTGLz/HgHO6K45vj5td1GlX8b5gDgbIMjMUO 1X3ufTCAn89G0IdDhm2yZbpB9M7DOjczpXOu27dAxni3d0puxa7aRxixXDGxVTxj6fWPz9 6lIV0ze23ULpMkaDXdsK5I/9HLv8xmQ= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-220--F3xdTPrN4Cs7EuAtL8IJg-1; Mon, 18 Nov 2019 09:52:43 -0500 Received: by mail-wr1-f69.google.com with SMTP id n11so3120935wrq.5 for ; Mon, 18 Nov 2019 06:52:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lCsn/X0nmr4hSWIgFPGsvpX5LzN+Uu1MiAqfZRe9+Lg=; b=BlKYn33y9Qi8E+Xtv2pwzqO5UEhdVnQu5l6Nw2klej06dOV/9tFtHatXpVpO6Gssrh 4FPA2Qx+BFlTVyC0ne/jGhupoczo7h0SGTcvgYu6rB5Cl0/8H0EYLJy6Vc6mgfFhtNeB tfxZx1EVzkhTfXfTQCRd334UZ478Y/svr3zS2xFjaeYrT7LuNN8CmGEDTusJSQvI3euA zA2SdDpKxI9mLxEbct1SBQDrf414IQ13tfmnqUpJtH+2RMldFQFvFO3IfrqH+9vHwDgb Ay5zan+v2tQ83VspxKNStdqD7ag94qYmvbifWQag9tb99rsGJtHL70KbJcV5A0CUxAS9 h/BA== X-Gm-Message-State: APjAAAXGZSn8qMNFCB+uoeX2q9Tg2Mpyjeifl8hXm9gpHkXtTrl478N/ byqhm9ooVm40wC7fqA+LN5DviVuYAhrKlh9ximfgCeqIvRCOFdvaSW17CCB8SNEXbtryPaqrq4v N975fjTdD3BLwhYqI0g== X-Received: by 2002:a1c:f404:: with SMTP id z4mr29518075wma.12.1574088761632; Mon, 18 Nov 2019 06:52:41 -0800 (PST) X-Google-Smtp-Source: APXvYqzcYHSUybkg8vlk+wVMCrxxq+uACtLM66OfFFuA0n6CHTDWsO8VV4wt+Uqux2oLoJ8L3CSPBg== X-Received: by 2002:a1c:f404:: with SMTP id z4mr29518048wma.12.1574088761352; Mon, 18 Nov 2019 06:52:41 -0800 (PST) Received: from localhost.localdomain.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id o5sm23044658wrx.15.2019.11.18.06.52.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2019 06:52:40 -0800 (PST) From: Ondrej Mosnacek To: selinux@vger.kernel.org Subject: [PATCH testsuite v4 3/3] travis: test building the test policy package Date: Mon, 18 Nov 2019 15:52:38 +0100 Message-Id: <20191118145238.408124-4-omosnace@redhat.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191118145238.408124-1-omosnace@redhat.com> References: <20191118145238.408124-1-omosnace@redhat.com> MIME-Version: 1.0 X-MC-Unique: -F3xdTPrN4Cs7EuAtL8IJg-1 X-Mimecast-Spam-Score: 0 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Download, build, and install Fedora policy & refpolicy and try building the test policy package against both of them. Signed-off-by: Ondrej Mosnacek Reviewed-by: Stephen Smalley Tested-by: Stephen Smalley --- .travis.yml | 48 ++++++++++++++++++++++++++--- policy/Makefile | 11 ++++--- travis-ci/enable-policy.sh | 10 ++++++ travis-ci/setup-policy-fedora.sh | 33 ++++++++++++++++++++ travis-ci/setup-policy-refpolicy.sh | 19 ++++++++++++ 5 files changed, 113 insertions(+), 8 deletions(-) create mode 100644 travis-ci/enable-policy.sh create mode 100644 travis-ci/setup-policy-fedora.sh create mode 100644 travis-ci/setup-policy-refpolicy.sh diff --git a/.travis.yml b/.travis.yml index fbbe98d..42b2490 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: c -dist: xenial +dist: bionic addons: apt: @@ -8,16 +8,56 @@ addons: - astyle - libselinux1-dev - libsctp-dev + - libaudit-dev + - libcap-dev + - libdbus-glib-1-dev + - xmlto + +cache: + directories: + - selinux-policy + - container-selinux + - refpolicy before_install: + - export LIBRARY_PATH=/usr/local/lib + - export LD_LIBRARY_PATH=/usr/local/lib # FYI: known good with HEAD at 8551fc60fc515cd290ba38ee8c758c1f4df52b56 - git clone https://github.com/perltidy/perltidy.git perltidy - | (cd perltidy && perl Makefile.PL && - make && - sudo make install) + make PREFIX=/usr/local && + sudo make install PREFIX=/usr/local) + # install libbpf from sources + - git clone https://github.com/libbpf/libbpf + - (cd libbpf/src && make PREFIX=/usr/local) + - (cd libbpf/src && sudo make install PREFIX=/usr/local) + # install keyutils from sources + - git clone https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git + - KEYUTILS_OPTS="" + - KEYUTILS_OPTS+="BINDIR=/usr/local/bin SBINDIR=/usr/local/sbin " + - KEYUTILS_OPTS+="LIBDIR=/usr/local/lib USRLIBDIR=/usr/local/lib " + - KEYUTILS_OPTS+="INCLUDEDIR=/usr/local/include " + - KEYUTILS_OPTS+="SHAREDIR=/usr/local/share/keyutils MANDIR=/usr/local/share/man" + - (cd keyutils && make $KEYUTILS_OPTS) + - (cd keyutils && sudo make install $KEYUTILS_OPTS) + # install SELinux userspace from source + - git clone https://github.com/SELinuxProject/selinux + - (cd selinux && sudo make install PREFIX=/usr/local SHLIBDIR=/usr/local/lib) + # install Fedora policy and refpolicy + - bash travis-ci/setup-policy-fedora.sh + - bash travis-ci/setup-policy-refpolicy.sh + # establish a fake "selinuxfs" mount (policy/Makefile just greps for selinuxfs) + - sudo mkdir -p /tmp/fake-selinuxfs + - sudo mount -t tmpfs tmpfs /tmp/fake-selinuxfs + - echo 999 >/tmp/fake-selinuxfs/policyvers script: - tools/check-syntax -f && git diff --exit-code - - make + - | + bash travis-ci/enable-policy.sh targeted && + make PREFIX=/usr/local POLDEV=/usr/share/selinux/targeted + - | + bash travis-ci/enable-policy.sh refpolicy && + make PREFIX=/usr/local POLDEV=/usr/share/selinux/refpolicy diff --git a/policy/Makefile b/policy/Makefile index ff65153..39ae84a 100644 --- a/policy/Makefile +++ b/policy/Makefile @@ -1,8 +1,11 @@ -POLDEV ?= /usr/share/selinux/devel -SEMODULE = /usr/sbin/semodule -CHECKPOLICY = /usr/bin/checkpolicy -CHECKMODULE = /usr/bin/checkmodule +PREFIX ?= /usr +BINDIR ?= $(PREFIX)/bin +SBINDIR ?= $(PREFIX)/sbin +POLDEV ?= $(PREFIX)/share/selinux/devel +SEMODULE = $(SBINDIR)/semodule +CHECKPOLICY = $(BINDIR)/checkpolicy +CHECKMODULE = $(BINDIR)/checkmodule DISTRO=$(shell ../tests/os_detect) diff --git a/travis-ci/enable-policy.sh b/travis-ci/enable-policy.sh new file mode 100644 index 0000000..ae53fbe --- /dev/null +++ b/travis-ci/enable-policy.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +# create a dummy /etc/selinux/config +sudo mkdir -p /etc/selinux +sudo tee /etc/selinux/config >/dev/null <