From nobody Thu May 15 10:19:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528102782962784.3662064888711; Mon, 4 Jun 2018 01:59:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C8626750EC; Mon, 4 Jun 2018 08:59:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CDA7308BDB0; Mon, 4 Jun 2018 08:59:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3C86D4CA88; Mon, 4 Jun 2018 08:59:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w548x9hD018650 for ; Mon, 4 Jun 2018 04:59:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 52B1F2026E0E; Mon, 4 Jun 2018 08:59:09 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB12A2026DEF for ; Mon, 4 Jun 2018 08:59:08 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 4 Jun 2018 10:58:46 +0200 Message-Id: <1c0d92508247575d71fa811ed2c05ceedc4b7728.1528102541.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/10] security: Remove VIR_SECURITY_MANAGER_ALLOW_DISK_PROBE X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 04 Jun 2018 08:59:41 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Nothing is setting that flag now so it can be removed. Note that removing 'mgr' from 'load_profile' in the apparmor driver would create a lot of churn. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/security/security_apparmor.c | 6 ++---- src/security/security_manager.c | 7 ------- src/security/security_manager.h | 5 +---- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/security/security_apparmor.c b/src/security/security_appar= mor.c index 333d098be4..cb41df71a9 100644 --- a/src/security/security_apparmor.c +++ b/src/security/security_apparmor.c @@ -170,7 +170,7 @@ profile_status_file(const char *str) * load (add) a profile. Will create one if necessary */ static int -load_profile(virSecurityManagerPtr mgr, +load_profile(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED, const char *profile, virDomainDefPtr def, const char *fn, @@ -180,8 +180,6 @@ load_profile(virSecurityManagerPtr mgr, bool create =3D true; char *xml =3D NULL; virCommandPtr cmd =3D NULL; - const char *probe =3D virSecurityManagerGetAllowDiskFormatProbing(mgr) - ? "1" : "0"; xml =3D virDomainDefFormat(def, NULL, VIR_DOMAIN_DEF_FORMAT_SECURE); if (!xml) @@ -190,7 +188,7 @@ load_profile(virSecurityManagerPtr mgr, if (profile_status_file(profile) >=3D 0) create =3D false; - cmd =3D virCommandNewArgList(VIRT_AA_HELPER, "-p", probe, + cmd =3D virCommandNewArgList(VIRT_AA_HELPER, create ? "-c" : "-r", "-u", profile, NULL); if (!create && fn) { diff --git a/src/security/security_manager.c b/src/security/security_manage= r.c index 71f7f59b9c..cacd1d5457 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -365,13 +365,6 @@ virSecurityManagerGetBaseLabel(virSecurityManagerPtr m= gr, } -bool -virSecurityManagerGetAllowDiskFormatProbing(virSecurityManagerPtr mgr) -{ - return mgr->flags & VIR_SECURITY_MANAGER_ALLOW_DISK_PROBE; -} - - bool virSecurityManagerGetDefaultConfined(virSecurityManagerPtr mgr) { diff --git a/src/security/security_manager.h b/src/security/security_manage= r.h index c36a8b488f..c5e472bba4 100644 --- a/src/security/security_manager.h +++ b/src/security/security_manager.h @@ -31,7 +31,6 @@ typedef struct _virSecurityManager virSecurityManager; typedef virSecurityManager *virSecurityManagerPtr; typedef enum { - VIR_SECURITY_MANAGER_ALLOW_DISK_PROBE =3D 1 << 0, VIR_SECURITY_MANAGER_DEFAULT_CONFINED =3D 1 << 1, VIR_SECURITY_MANAGER_REQUIRE_CONFINED =3D 1 << 2, VIR_SECURITY_MANAGER_PRIVILEGED =3D 1 << 3, @@ -40,8 +39,7 @@ typedef enum { } virSecurityManagerNewFlags; # define VIR_SECURITY_MANAGER_NEW_MASK \ - (VIR_SECURITY_MANAGER_ALLOW_DISK_PROBE | \ - VIR_SECURITY_MANAGER_DEFAULT_CONFINED | \ + (VIR_SECURITY_MANAGER_DEFAULT_CONFINED | \ VIR_SECURITY_MANAGER_REQUIRE_CONFINED | \ VIR_SECURITY_MANAGER_PRIVILEGED) @@ -89,7 +87,6 @@ const char *virSecurityManagerGetDOI(virSecurityManagerPt= r mgr); const char *virSecurityManagerGetModel(virSecurityManagerPtr mgr); const char *virSecurityManagerGetBaseLabel(virSecurityManagerPtr mgr, int = virtType); -bool virSecurityManagerGetAllowDiskFormatProbing(virSecurityManagerPtr mgr= ); bool virSecurityManagerGetDefaultConfined(virSecurityManagerPtr mgr); bool virSecurityManagerGetRequireConfined(virSecurityManagerPtr mgr); bool virSecurityManagerGetPrivileged(virSecurityManagerPtr mgr); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list