From nobody Sun May 5 12:40:40 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150037506870427.26579017208462; Tue, 18 Jul 2017 03:51:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F28E2C04B92E; Tue, 18 Jul 2017 10:51:06 +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 2E31C7F7E1; Tue, 18 Jul 2017 10:51:06 +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 85B544A491; Tue, 18 Jul 2017 10:51:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6IAp2MZ015407 for ; Tue, 18 Jul 2017 06:51:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 91E387EE76; Tue, 18 Jul 2017 10:51:02 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF6A07EA5B; Tue, 18 Jul 2017 10:50:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F28E2C04B92E Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com F28E2C04B92E From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 18 Jul 2017 12:51:04 +0200 Message-Id: <2e18140b97623eee57ac5bc7c1253746d1d17f94.1500375034.git.pkrempa@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Christian Ehrhardt Subject: [libvirt] [PATCH] security: apparmor: Properly link with storage driver in helper program 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 18 Jul 2017 10:51:07 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The refactor to split up storage driver into modules broke the apparmor helper program, since that did not initialize the storage driver properly and thus detection of the backing chain could not work. Register the storage driver backends explicitly. Unfortunately it's now necessary to link with the full storage driver to satisfy dependencies of the loadable modules. --- src/Makefile.am | 2 +- src/security/virt-aa-helper.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 399d031dd..e637dfd91 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3281,7 +3281,7 @@ virt_aa_helper_LDADD =3D \ libvirt.la \ libvirt_conf.la \ libvirt_util.la \ - libvirt_driver_storage_impl.la \ + libvirt_driver_storage.la \ ../gnulib/lib/libgnu.la if WITH_DTRACE_PROBES virt_aa_helper_LDADD +=3D libvirt_probes.lo diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 695272076..a751d6deb 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -56,6 +56,7 @@ #include "virgettext.h" #include "storage/storage_source.h" +#include "storage/storage_backend.h" #define VIR_FROM_THIS VIR_FROM_SECURITY @@ -926,6 +927,11 @@ get_files(vahControl * ctl) goto cleanup; } + if (virStorageBackendDriversRegister(false) < 0) { + vah_error(ctl, 0, _("failed to register storage driver backend")); + goto cleanup; + } + for (i =3D 0; i < ctl->def->ndisks; i++) { virDomainDiskDefPtr disk =3D ctl->def->disks[i]; @@ -1283,6 +1289,8 @@ main(int argc, char **argv) exit(EXIT_FAILURE); } + virFileActivateDirOverride(argv[0]); + /* Initialize the log system */ virLogSetFromEnv(); --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list