From patchwork Tue Jun 23 12:36:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Mosnacek X-Patchwork-Id: 11620635 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 C5A881392 for ; Tue, 23 Jun 2020 12:37:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ACFC520738 for ; Tue, 23 Jun 2020 12:37:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="W2GqVzW0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732618AbgFWMhL (ORCPT ); Tue, 23 Jun 2020 08:37:11 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:57425 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729611AbgFWMhK (ORCPT ); Tue, 23 Jun 2020 08:37:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592915829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c5P+U8IcWcn+FoMRhSlbLGo4kHHroRUUqScou366eC4=; b=W2GqVzW0Gz05pLXUs6Ewkrse/g/DwgPHqt/dpCR+sujPGzwzIso2H5c+2PhvPNLQdV35Nx 8Nzy/0+nHRF+aHcLXG3z4E0CYcyp22bcoq9pBa2v+P8CoHIananAYHpSyLkQQ7/FY5jEDD gP8pP5ITfvRi7lF3Xw21d374CU3loBY= 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-135-ef2WL2heMzqDvgzjod6C_g-1; Tue, 23 Jun 2020 08:37:07 -0400 X-MC-Unique: ef2WL2heMzqDvgzjod6C_g-1 Received: by mail-wr1-f69.google.com with SMTP id r5so15513201wrt.9 for ; Tue, 23 Jun 2020 05:37:07 -0700 (PDT) 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=c5P+U8IcWcn+FoMRhSlbLGo4kHHroRUUqScou366eC4=; b=gxIIg0wkV5Nt3TMldYhSPumh8sxAsVbVTVa2PyXlGCBRngaAAQE2L7s7HRJ6Qt6Doj bFxZ9f6cUC7bWauWEmm0hkX9IzrFfxtKNhmJxyFgKm2uopRn9aVteOIUffvm46zXJnhI kWilFhEq31Rjx9VuN34nfO6Xel/1vDoHZlv3y3imx54FU8shuioV4GI0DYAXa2cCFt84 N5/SJ62JSgn2jzz1wTVHVlxhw1/1v6C2qqf5IsYfpmIl9W2JXHcK+/3Z7T4r60fEuR4L G1pS8ulkp82PWjEZho+xI/xgj1lgqbNF1gw7M/n/mLqUEoWZms9B1sZMH2tBP29myoUW +k2g== X-Gm-Message-State: AOAM533hliNduIof5XkMHJjLNSu5HoImCw6PTXQgEzbrOYykoITipl3F vE5LK0L8jo6mDpl3wUiutm2x6exUcabVrqkX8r8v6E/euF/sgDCo/vgyOH3iXVhXCCk4Iui6CTN jCC4xHQtgOYC2sq3MLA== X-Received: by 2002:adf:fa8b:: with SMTP id h11mr22972636wrr.391.1592915826277; Tue, 23 Jun 2020 05:37:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwb0dHatkxbMbVS/yoyMp6nbAMKJhKngPuTcbSiHs92FLnQhmR1sEaKS4Jzjn6imMaXGj4V5Q== X-Received: by 2002:adf:fa8b:: with SMTP id h11mr22972619wrr.391.1592915826082; Tue, 23 Jun 2020 05:37:06 -0700 (PDT) Received: from omos.redhat.com ([2a02:8308:b13f:2100:f695:3ae5:c8bf:2f57]) by smtp.gmail.com with ESMTPSA id p9sm3449729wma.48.2020.06.23.05.37.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 05:37:05 -0700 (PDT) From: Ondrej Mosnacek To: selinux@vger.kernel.org Subject: [PATCH testsuite 1/4] Makefiles: remove bashisms Date: Tue, 23 Jun 2020 14:36:59 +0200 Message-Id: <20200623123702.401338-2-omosnace@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200623123702.401338-1-omosnace@redhat.com> References: <20200623123702.401338-1-omosnace@redhat.com> MIME-Version: 1.0 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org In Travis CI (Ubuntu), the shell used by Make doesn't understand bashisms like [[ ... ]]. Replace them with plain [ ... ] and also break up the conditionals for better readabilty. Signed-off-by: Ondrej Mosnacek Acked-by: Stephen Smalley --- policy/Makefile | 4 +++- tests/Makefile | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/policy/Makefile b/policy/Makefile index 672733e..6c49091 100644 --- a/policy/Makefile +++ b/policy/Makefile @@ -37,13 +37,15 @@ endif ifeq ($(SUPPORTS_CIL),y) CIL_TARGETS = test_mlsconstrain.cil test_overlay_defaultrange.cil -ifeq ($(shell [[ $(MAX_KERNEL_POLICY) -ge 32 && $(POL_VERS) -ge 32 ]] && echo true),true) +ifeq ($(shell [ $(MAX_KERNEL_POLICY) -ge 32 ] && echo true),true) +ifeq ($(shell [ $(POL_VERS) -ge 32 ] && echo true),true) # If other MLS tests get written this can be moved outside of the glblub test ifeq ($(POL_TYPE), MLS) CIL_TARGETS += test_glblub.cil else ifeq ($(POL_TYPE), MCS) CIL_TARGETS += test_add_levels.cil test_glblub.cil endif # POL_TYPE +endif # POL_VERS endif # MAX_KERNEL_POLICY endif # SUPPORTS_CIL diff --git a/tests/Makefile b/tests/Makefile index bdbdf3e..919335b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -68,9 +68,13 @@ ifeq ($(shell grep -q key_socket $(POLDEV)/include/support/all_perms.spt && test SUBDIRS += key_socket endif -ifeq ($(shell [[ $(MAX_KERNEL_POLICY) -ge 32 && ( $(POL_TYPE) == 'MLS' || $(POL_TYPE) == 'MCS' ) && $(POL_VERS) -ge 32 ]] && echo true),true) +ifeq ($(shell [ $(MAX_KERNEL_POLICY) -ge 32 ] && echo true),true) +ifeq ($(shell [ $(POL_TYPE) = 'MLS' ] || [ $(POL_TYPE) = 'MCS' ] && echo true),true) +ifeq ($(shell [ $(POL_VERS) -ge 32 ] && echo true),true) SUBDIRS += glblub -endif +endif # POL_VERS +endif # POL_TYPE +endif # MAX_KERNEL_POLICY ifeq ($(shell grep "^SELINUX_INFINIBAND_ENDPORT_TEST=" infiniband_endport/ibendport_test.conf | cut -d'=' -f 2),1) SUBDIRS += infiniband_endport From patchwork Tue Jun 23 12:37:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Mosnacek X-Patchwork-Id: 11620637 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 D8D9990 for ; Tue, 23 Jun 2020 12:37:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C03602072E for ; Tue, 23 Jun 2020 12:37:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d42aep4J" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732619AbgFWMhM (ORCPT ); Tue, 23 Jun 2020 08:37:12 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:21528 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732597AbgFWMhM (ORCPT ); Tue, 23 Jun 2020 08:37:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592915830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qp+2dD8mc/Q81/qimrHzD/csfblw2q5C6Rz/aFEaQ6M=; b=d42aep4JRqRyqLv8T+Ww8LKNvjQAv7L0hlya7mJWAfKHYwEFjQYLD92Gho8EPH/rGtx3Gp kZnD6JEghsyN9YZ3pShQalDyv4o6Lkb/IpthMEXnmmOy2rkIaOuscH2mnpdv1IXbInWHty tKxISVTUAZ15F8qlvbAWZ/DIg/BauxI= 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-401-cF_8C6_dM7qvUrWbC0W5Yw-1; Tue, 23 Jun 2020 08:37:08 -0400 X-MC-Unique: cF_8C6_dM7qvUrWbC0W5Yw-1 Received: by mail-wr1-f70.google.com with SMTP id p10so15508493wrn.19 for ; Tue, 23 Jun 2020 05:37:08 -0700 (PDT) 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=Qp+2dD8mc/Q81/qimrHzD/csfblw2q5C6Rz/aFEaQ6M=; b=S908PUDyhq/d1N++kyhkMKc+VJVRwmeS54Ug3CbeWODseDf8nRLnK74AJ2mJsYoK9X 8F4i17y7TZ9aWXgxJGXV3S8uLfdXM5KMm4JNyZbm2y9o2ME3wQFf4WtEbUNoAnxdRP7L eP1hNcAbpXFSzg5zRtQN0pc8BS++TanY/k2mOhGolY0wl623RLTNuI+ONnfjeclRoY6d nOhU//OEze1xYWfL9q1pY2zz29u3sOcU8ecIC+5plszH8eCkj3ytbZxkqVyFSLof22zF 1qlkQTgeN6yRrHpNreyHbwVrK0ecLHuGhjhyNlxZZ+YfZ6jTfyiAKDiCDGPLptEAfU90 fTpA== X-Gm-Message-State: AOAM531/VQsUl+RT9C1ppcFgHv5YIJou9td/13itzGHLqlw+0KFzJZyW shnTxLa6XVU85ylgR8VV1xD+XuOK1Gd/srTjC1EzLxFYL6wKsVZnH6lTVw5yA1ZSitiqJv9B/fJ bKi66LGVBBOF2RwBpCQ== X-Received: by 2002:a7b:c5c1:: with SMTP id n1mr23285730wmk.21.1592915827484; Tue, 23 Jun 2020 05:37:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypN4XQEb+6n7NPWyARB3l5dYV8MQujGiPOopDaZgUz94YCV0iBlhUr+avkX8kF58r6OXzrsQ== X-Received: by 2002:a7b:c5c1:: with SMTP id n1mr23285711wmk.21.1592915827184; Tue, 23 Jun 2020 05:37:07 -0700 (PDT) Received: from omos.redhat.com ([2a02:8308:b13f:2100:f695:3ae5:c8bf:2f57]) by smtp.gmail.com with ESMTPSA id p9sm3449729wma.48.2020.06.23.05.37.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 05:37:06 -0700 (PDT) From: Ondrej Mosnacek To: selinux@vger.kernel.org Subject: [PATCH testsuite 2/4] travis: add missing node to fake selinuxfs Date: Tue, 23 Jun 2020 14:37:00 +0200 Message-Id: <20200623123702.401338-3-omosnace@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200623123702.401338-1-omosnace@redhat.com> References: <20200623123702.401338-1-omosnace@redhat.com> MIME-Version: 1.0 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Since commit e95fe9503816 ("Add tests for default_range glblub") we look at $(SELINUXFS)/initial_contexts/kernel to determine the type of the policy. However, this node is not provided by the fake selinuxfs created by our CI scripts, leading to non-fatal errors like this: [...] make[1]: Entering directory '/home/travis/build/WOnder93/selinux-testsuite/policy' cat: /tmp/fake-selinuxfs/initial_contexts/kernel: No such file or directory [...] Create that node and fill it with the ussual kernel context to silence the errors. Signed-off-by: Ondrej Mosnacek Acked-by: Stephen Smalley --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 18ab6b9..ae08c66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,6 +55,8 @@ before_install: # establish a fake "selinuxfs" mount (policy/Makefile just greps for selinuxfs) - mkdir -p /tmp/fake-selinuxfs/policy_capabilities - echo 1 > /tmp/fake-selinuxfs/policy_capabilities/extended_socket_class + - mkdir -p /tmp/fake-selinuxfs/initial_contexts + - echo system_u:system_r:kernel_t:s0 > /tmp/fake-selinuxfs/initial_contexts/kernel - echo 999 >/tmp/fake-selinuxfs/policyvers script: From patchwork Tue Jun 23 12:37:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Mosnacek X-Patchwork-Id: 11620643 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 32EE11392 for ; Tue, 23 Jun 2020 12:37:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B6C72072E for ; Tue, 23 Jun 2020 12:37:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QA/162Ak" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732627AbgFWMhQ (ORCPT ); Tue, 23 Jun 2020 08:37:16 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:55044 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729611AbgFWMhQ (ORCPT ); Tue, 23 Jun 2020 08:37:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592915835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kNtyxHB6E7Z0SJoNFTQlSwZsiWPKhoHLbzJCv3GxjkY=; b=QA/162Akn3J79hdtCBgfV6N/M/vDzY9Xu+EQZbBDeOaEmyDb/GHJwnyiXEWwPUKOOumtHf B+jahSKkFyqHFIioCpt52+Ke1g2sKtbCj93nCxwGTxM1UktOamJsrR6MEEC/cD90WwrGay jYygx87CBAdLymYmvf4Og1iCBTryajE= 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-487-70aCvwUrN7-RR2rteuHmDg-1; Tue, 23 Jun 2020 08:37:09 -0400 X-MC-Unique: 70aCvwUrN7-RR2rteuHmDg-1 Received: by mail-wr1-f70.google.com with SMTP id l3so6216147wrw.4 for ; Tue, 23 Jun 2020 05:37:09 -0700 (PDT) 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=kNtyxHB6E7Z0SJoNFTQlSwZsiWPKhoHLbzJCv3GxjkY=; b=IqWu93R8A6PkIAE9Uskv42KIAGz0LOJta4rRF+TISmLqwSCt8pYsbONR/BxgQK4IBH kfomxCuB8JcxE/t6UOhrAA+d+JyRYB/mjBTdRJxYv0kgDJ2Cx7csCamRE7DZWPKqMUXd cE0n37dMan1gQAmj0LDHzB4z3YWhdaOtvzAGc9SJd+ucGWpDCAf5YEwq4y9oZtWMx/0h Qc/7WGp0jdPbimpD7o/RLXvKhVfAcZjJTD/nC5cIX6BVc4uFeN73uYMhVsdkxSIvOD8C 4/+KFoGqHgMPNM6Zh/0e030PHY7Yo1SzByJRCHyUDg3/Di7MsCGKsZnDaonbGYv2I5jy UJaA== X-Gm-Message-State: AOAM533Itp6RDjYNgoC6syXNkvdgaLYl9PeGrcFHlSb88+PQGNuKgfGx erwmUtpXDheVrY9ok9Cxq/bUO2vyruagxnzrhc2YcB4td0SSnyt0enf9oh5UpwKcxyrmmlLWdLe Yvk+Bd+sBcbjPRCapYA== X-Received: by 2002:a05:600c:221a:: with SMTP id z26mr17246986wml.177.1592915828355; Tue, 23 Jun 2020 05:37:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwex/d4Fr7QBEF275MMfS8AdY855pkmA5OVQODKq628e/M80bvGU1co4dTN1U4oEI/IBfTb9Q== X-Received: by 2002:a05:600c:221a:: with SMTP id z26mr17246964wml.177.1592915828045; Tue, 23 Jun 2020 05:37:08 -0700 (PDT) Received: from omos.redhat.com ([2a02:8308:b13f:2100:f695:3ae5:c8bf:2f57]) by smtp.gmail.com with ESMTPSA id p9sm3449729wma.48.2020.06.23.05.37.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 05:37:07 -0700 (PDT) From: Ondrej Mosnacek To: selinux@vger.kernel.org Subject: [PATCH testsuite 3/4] travis: fix git/cache handling Date: Tue, 23 Jun 2020 14:37:01 +0200 Message-Id: <20200623123702.401338-4-omosnace@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200623123702.401338-1-omosnace@redhat.com> References: <20200623123702.401338-1-omosnace@redhat.com> MIME-Version: 1.0 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org The current way of fetching new changes from git blows up when there has been a force-push. Switch to just fetching and then checking out the remote branch directly rather than using git pull. Signed-off-by: Ondrej Mosnacek Acked-by: Stephen Smalley --- travis-ci/setup-policy-fedora.sh | 10 ++++++---- travis-ci/setup-policy-refpolicy.sh | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/travis-ci/setup-policy-fedora.sh b/travis-ci/setup-policy-fedora.sh index d2793f0..bce8698 100644 --- a/travis-ci/setup-policy-fedora.sh +++ b/travis-ci/setup-policy-fedora.sh @@ -4,11 +4,12 @@ set -ex if ! [ -d selinux-policy/.git ]; then git clone --recursive https://github.com/fedora-selinux/selinux-policy - (cd selinux-policy/policy/modules/contrib && git checkout rawhide) else - (cd selinux-policy && git pull || { git checkout '*' && git pull; }) - (cd selinux-policy/policy/modules/contrib && git pull) + git -C selinux-policy fetch origin + git -C selinux-policy/policy/modules/contrib fetch origin fi +git -C selinux-policy checkout origin/rawhide +git -C selinux-policy/policy/modules/contrib checkout origin/rawhide if ! [ -d container-selinux/.git ]; then git clone https://github.com/containers/container-selinux.git @@ -17,8 +18,9 @@ if ! [ -d container-selinux/.git ]; then selinux-policy/policy/modules/contrib/$f done else - (cd container-selinux && git pull) + git -C container-selinux fetch origin fi +git -C container-selinux checkout origin/master cd selinux-policy diff --git a/travis-ci/setup-policy-refpolicy.sh b/travis-ci/setup-policy-refpolicy.sh index abd4ca4..3010467 100644 --- a/travis-ci/setup-policy-refpolicy.sh +++ b/travis-ci/setup-policy-refpolicy.sh @@ -5,11 +5,13 @@ set -ex if ! [ -d refpolicy/.git ]; then git clone https://github.com/SELinuxProject/refpolicy else - git pull || { git checkout '*' && git pull; } + git -C refpolicy fetch origin fi cd refpolicy +git checkout origin/master + [ -f policy/modules.conf ] || make conf make -j`nproc --all` BINDIR=/usr/local/bin SBINDIR=/usr/local/sbin From patchwork Tue Jun 23 12:37:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ondrej Mosnacek X-Patchwork-Id: 11620641 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 8E8AB1392 for ; Tue, 23 Jun 2020 12:37:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7713A20738 for ; Tue, 23 Jun 2020 12:37:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LBKNhUrK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732620AbgFWMhP (ORCPT ); Tue, 23 Jun 2020 08:37:15 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:43765 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729611AbgFWMhO (ORCPT ); Tue, 23 Jun 2020 08:37:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592915833; 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=vz3a8vvv+EnpRx4Om9TtvGKqCz8jGEWgzHEej5jXIAo=; b=LBKNhUrKATLGErJIWX53uMjKrVLuTgd+7oqc6xZKNfvQfXpHQolaKrXsngy91LAeNW9ehr Jo+XJ7a/XswEX+AkWpX/xV6xwPwPSFt6RplFkuxWpd12b0+3TdRvC83lmRb69UIEIbiKd4 NxTGhCjyEfvTqF181eERu9kIKqWT9HQ= 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-263-tqZpzhsGP4unlKhDOWaW0w-1; Tue, 23 Jun 2020 08:37:10 -0400 X-MC-Unique: tqZpzhsGP4unlKhDOWaW0w-1 Received: by mail-wr1-f69.google.com with SMTP id g14so8640925wrp.8 for ; Tue, 23 Jun 2020 05:37:10 -0700 (PDT) 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=vz3a8vvv+EnpRx4Om9TtvGKqCz8jGEWgzHEej5jXIAo=; b=WJ7dh6nSqQYEJc9gvRhGT/bYW+duq4hiNDw975r6IhcsaH//C82rHqOIbZ9a579j54 /H2vPOY+6eckCbPA/XkrboGPIHuVDjgqquhCEVP9nINjXfBi/2fToPrtaDSYNwAL5DPY I577573VHfqilw0MJKl2WoNyFjy/A3FutZFy1SLsIn+PvwwOfMs9AqhHsGJpMb/hnBbH N5zVunApzaba663nHSUyqCAoH1XuddX+xkPb8A24yJONicwRgWUwWFkVZXyRpg+p+UUV gKvJFRa7Uzu1wfGFGxgKqd+jhdymWwM9OOK610l1JWg46xK+vnIQa95ZeaKLd4dzaq95 r53g== X-Gm-Message-State: AOAM531sKb4kg2fW5SURS/nHlQm8TlViqyglgjsscn+iGkcOfRnOs06G TNDQtjj9REPmSm3I9CuTtmh/+7Ryo1rOF9h3Nm3B2C4G7M3pbAHWSa+CgbCrsapJNwZxPfyjFn0 3ABsNkD8l45NILAaViQ== X-Received: by 2002:a5d:6045:: with SMTP id j5mr17954570wrt.209.1592915829137; Tue, 23 Jun 2020 05:37:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLe5ah8PmJqWhDb39c+LXCkt2PJ9Yks+utwQhwLeRZPcjo4JC1iTy3c1SgmSQbFHOizHdagQ== X-Received: by 2002:a5d:6045:: with SMTP id j5mr17954542wrt.209.1592915828831; Tue, 23 Jun 2020 05:37:08 -0700 (PDT) Received: from omos.redhat.com ([2a02:8308:b13f:2100:f695:3ae5:c8bf:2f57]) by smtp.gmail.com with ESMTPSA id p9sm3449729wma.48.2020.06.23.05.37.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 05:37:08 -0700 (PDT) From: Ondrej Mosnacek To: selinux@vger.kernel.org Subject: [PATCH testsuite 4/4] tests: stop using deprecated security_context_t Date: Tue, 23 Jun 2020 14:37:02 +0200 Message-Id: <20200623123702.401338-5-omosnace@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200623123702.401338-1-omosnace@redhat.com> References: <20200623123702.401338-1-omosnace@redhat.com> MIME-Version: 1.0 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org In Travis CI, GCC reports in several places: gcc -g -O0 -Wall -D_GNU_SOURCE -DHAVE_BPF parent.c -lselinux -o parent parent.c: In function ‘main’: parent.c:25:2: warning: ‘security_context_t’ is deprecated [-Wdeprecated-declarations] security_context_t context_s; ^~~~~~~~~~~~~~~~~~ Fix this by using plain char * instead of security_context_t. Signed-off-by: Ondrej Mosnacek Acked-by: Stephen Smalley --- tests/bounds/thread.c | 4 ++-- tests/dyntrace/parent.c | 2 +- tests/dyntrans/parent.c | 2 +- tests/execshare/parent.c | 2 +- tests/exectrace/parent.c | 2 +- tests/inherit/parent.c | 2 +- tests/prlimit/parent.c | 2 +- tests/setnice/parent.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/bounds/thread.c b/tests/bounds/thread.c index d09a634..acb976f 100644 --- a/tests/bounds/thread.c +++ b/tests/bounds/thread.c @@ -19,7 +19,7 @@ static int thread_status = 0; static void *worker(void *datap) { - security_context_t security_context = datap; + char *security_context = datap; int rc; rc = setcon(security_context); @@ -31,7 +31,7 @@ static void *worker(void *datap) int main(int argc, char *argv[]) { - security_context_t security_context; + char *security_context; context_t context; pthread_t thread; int rc; diff --git a/tests/dyntrace/parent.c b/tests/dyntrace/parent.c index a3a644e..63cbd76 100644 --- a/tests/dyntrace/parent.c +++ b/tests/dyntrace/parent.c @@ -12,7 +12,7 @@ int main(int argc, char **argv) { int pid, rc, status; - security_context_t context_s; + char *context_s; context_t context; char *child_argv[3]; diff --git a/tests/dyntrans/parent.c b/tests/dyntrans/parent.c index 660a1d5..c8320cc 100644 --- a/tests/dyntrans/parent.c +++ b/tests/dyntrans/parent.c @@ -11,7 +11,7 @@ int main(int argc, char **argv) { int rc; - security_context_t context_s; + char *context_s; context_t context; if (argc != 2) { diff --git a/tests/execshare/parent.c b/tests/execshare/parent.c index 2357265..5b9bd80 100644 --- a/tests/execshare/parent.c +++ b/tests/execshare/parent.c @@ -22,7 +22,7 @@ int main(int argc, char **argv) int pagesize; void *clone_stack, *page; int pid, rc, status, cloneflags; - security_context_t context_s; + char *context_s; context_t context; if (argc != 4) { diff --git a/tests/exectrace/parent.c b/tests/exectrace/parent.c index 88adb56..6906ee9 100644 --- a/tests/exectrace/parent.c +++ b/tests/exectrace/parent.c @@ -11,7 +11,7 @@ int main(int argc, char **argv) { int pid, rc, status; - security_context_t context_s; + char *context_s; context_t context; if (argc != 3) { diff --git a/tests/inherit/parent.c b/tests/inherit/parent.c index be48b79..10b59b4 100644 --- a/tests/inherit/parent.c +++ b/tests/inherit/parent.c @@ -9,7 +9,7 @@ int main(int argc, char **argv) { char **childargv; - security_context_t context_s; + char *context_s; context_t context; int rc, fd; diff --git a/tests/prlimit/parent.c b/tests/prlimit/parent.c index 11c0c25..b735445 100644 --- a/tests/prlimit/parent.c +++ b/tests/prlimit/parent.c @@ -26,7 +26,7 @@ int main(int argc, char **argv) { char buf[1]; int pid, rc, fd[2], fd2[2], opt; - security_context_t context_s; + char *context_s; context_t context; struct rlimit newrlim, oldrlim, *newrlimp = NULL, *oldrlimp = NULL; bool get = false, set = false, soft = false; diff --git a/tests/setnice/parent.c b/tests/setnice/parent.c index b010aa0..bbb0c7f 100644 --- a/tests/setnice/parent.c +++ b/tests/setnice/parent.c @@ -14,7 +14,7 @@ int main(int argc, char **argv) { char buf[1]; int pid, rc, rc2, fd[2], fd2[2]; - security_context_t context_s; + char *context_s; context_t context; if (argc != 3) {