From nobody Tue Feb 10 19:47:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622536818; cv=none; d=zohomail.com; s=zohoarc; b=TgYOGGwltCMGn8DIrmgjH7URZH6zSnBfnD8GQorAnTGYrCbp0EmVPTwM9gF4vZpltp5Py9BS5iUgxwn/P3AZeQuBNBd00QwtHu5r6zpvaIGbR79fR3XdExDO2EnI8C5pcbGtq0boxEH5+D42eJZCKi2XXAySkQ0fOWlJoe3jShg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622536818; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sic3GoQZVEHyMU7K8Ye3zAWKQG9N68V8ad5/Gj5IKvs=; b=FtJ0QJdOjg8h/wq5QAde16QRPEDrE0q4BI8ASNCzdnBuaYUu1QArBQRFECdncSYm5BZUFDqULSPN76H/qgKR11gISOU251hHeftRObPesYEyrRsAEywLgVo9lb27Dh3rB8euRjCrkThrNRwqfpLXM2HlddbLFBbtV8iBdhmRGTw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1622536818700518.4178248194222; Tue, 1 Jun 2021 01:40:18 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-UjfLaDyrNf-uKReQnPquig-1; Tue, 01 Jun 2021 04:38:37 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6C551899457; Tue, 1 Jun 2021 08:38:31 +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 9459F5D9D0; Tue, 1 Jun 2021 08:38:31 +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 5700755353; Tue, 1 Jun 2021 08:38:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1518cG9d026026 for ; Tue, 1 Jun 2021 04:38:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7F94717A63; Tue, 1 Jun 2021 08:38:16 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7D8E2ED63 for ; Tue, 1 Jun 2021 08:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622536817; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sic3GoQZVEHyMU7K8Ye3zAWKQG9N68V8ad5/Gj5IKvs=; b=YCVHc98cLKeIW6OTQZI8on3nHaSyF2anEu1X5z/z9k4hAdgISmMtaNoX6nFVsQ335yovLU 8SSj/L64T5c2cIwFlVaP/jIYYQpKpHQcHbUem87H/BKS5i9WkKnBKPWQGP9d9aOuWkm2Us CoBqAtKpT+tNPOlqJbRZ45o/WVOAQgQ= X-MC-Unique: UjfLaDyrNf-uKReQnPquig-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 12/26] meson: Rewrite polkit check Date: Tue, 1 Jun 2021 10:37:43 +0200 Message-Id: <20210601083757.10194-13-abologna@redhat.com> In-Reply-To: <20210601083757.10194-1-abologna@redhat.com> References: <20210601083757.10194-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The new version will report an error if the user asks for polkit support to be enabled on Windows instead of silently ignoring such requests. Signed-off-by: Andrea Bolognani --- meson.build | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 328d4d1c5f..3ee8694886 100644 --- a/meson.build +++ b/meson.build @@ -1085,12 +1085,6 @@ parallels_sdk_dep =3D dependency('parallels-sdk', ve= rsion: '>=3D' + parallels_sdk_ve pciaccess_version =3D '0.10.0' pciaccess_dep =3D dependency('pciaccess', version: '>=3D' + pciaccess_vers= ion, required: get_option('pciaccess')) =20 -if not get_option('polkit').disabled() and host_machine.system() !=3D 'win= dows' - pkcheck_prog =3D find_program('pkcheck', required: false, dirs: libvirt_= sbin_path) -else - pkcheck_prog =3D dependency('', required: false) -endif - rbd_dep =3D cc.find_library('rbd', required: false) rados_dep =3D cc.find_library('rados', required: false) if rbd_dep.found() and not cc.has_function('rbd_get_features', dependencie= s: rbd_dep) @@ -1353,8 +1347,24 @@ elif get_option('firewalld_zone').enabled() error('You must have firewalld support enabled to enable firewalld_zone') endif =20 -if (pkcheck_prog.found() or get_option('polkit').enabled()) - conf.set('WITH_POLKIT', 1) +if not get_option('polkit').disabled() + polkit_enable =3D true + + if get_option('polkit').auto() + pkcheck_prog =3D find_program('pkcheck', required: false, dirs: libvir= t_sbin_path) + polkit_enable =3D pkcheck_prog.found() + endif + + if host_machine.system() =3D=3D 'windows' + polkit_enable =3D false + if get_option('polkit').enabled() + error('polkit support cannot be enabled on Windows') + endif + endif + + if polkit_enable + conf.set('WITH_POLKIT', 1) + endif endif =20 if udev_dep.found() and not pciaccess_dep.found() --=20 2.31.1