From nobody Sun Feb 8 10:48:32 2026 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1569271516; cv=none; d=zoho.com; s=zohoarc; b=PyDa57To1wQqlAnAT9Jl0jsHN0zzFEOiUTjI97mw0kfF58q0QigW1uUxjy3kxAeIzbQuix0ObFke9o6AOe7kvo426qUTSZvPSyTzEyQSmb6AYfzgB/a3YTf09ezLg32zXElBRcxn2VII6Wn6dVhMO+9WidYw2Cg2J2MBnM6O/FI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271516; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=RLrfUaI4nMqZ4/MYFL5qwFOG5z97X6EqmG2aYg91g3Y=; b=IP1kGTjgdLXut5cABO5GWtE9CK/4K8GMnW0cPuFh9zD47YME15N7a2LJOcGXEl696LOKV861vplHLjbCFf+vFbzrkUpvhYE0Mdjx0qAzVRADjlwK9YPMOLELHDaPHVDa6FooUgylHDAiB6F/4yX+VRTi37mBKLulRnvc/RKbFkQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569271516237420.51471475553194; Mon, 23 Sep 2019 13:45:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 75EF819D335; Mon, 23 Sep 2019 20:45:14 +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 430E060623; Mon, 23 Sep 2019 20:45:14 +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 E5A1E4EE6A; Mon, 23 Sep 2019 20:45:13 +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 x8NKir8K031733 for ; Mon, 23 Sep 2019 16:44:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5BAD2620B1; Mon, 23 Sep 2019 20:44:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5A7760475; Mon, 23 Sep 2019 20:44:52 +0000 (UTC) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 575963082133; Mon, 23 Sep 2019 20:44:51 +0000 (UTC) Received: by mail-qt1-f179.google.com with SMTP id o12so18888497qtf.3; Mon, 23 Sep 2019 13:44:51 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id z13sm5343974qkj.34.2019.09.23.13.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UHI56T4A8mMsjWus+aZP8pFFO5Uds6OLQdp9iQ9tZHE=; b=E7Bi2ZEcvoIN4TEn/+bolYedgmRCN09BuwlNr2KhGlaOnMZ5a5JSc6guPvwVjlQ/cV SEZ1bqIRX8c0GdwIYrqQH2kwBd3hsqYuffiEZQZuOMYcdwEr3jeLS9z+ZHMy5GDPowbj oWezn6Lh51FpVzc6yUgaFHJkWIv+7GEpgkN/IJulJh3izfhAZi1U4pydPj8YEO3PNlWQ 7n+N/t4N+wqaHR784mPn1YBBMQf4sK6MujxMpzhcVrhtjnzpJdt0Wgf/rdtumXpCENwL P/uT1MKvfNRuwHjrk6iFnqABpsK8C0txTJw+/smrcbO3QGsHWKzT7YI831Ps3ghwEf9L jVtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UHI56T4A8mMsjWus+aZP8pFFO5Uds6OLQdp9iQ9tZHE=; b=CdOmv8eEdKzRu5rjsKsvRtjUPV/nTwHqlTdge0MdpfOKgEgET6GA3yl46tMn7ERS1H mo9zHDIPO6axdZZeMc52cAV0AKSgbI3qNfvH5l87Gw1LWNnvJ+3NRaDLDgN4SAcIh0r/ sVqZVyMIiR9Lr+zLQ+9mJovoDf8OSwC3IwK1MmgZMA1Us5TAEdQwNRMh04ys8AIiEQfd F2fLYcbdXmuF5JDReXvYfgi+E/xbUS9xW+xgBd07oTOg6bAS4KpcT4VsOOHCSJA/bvLO basTXKf1k2G3qLkQtcGWEoIwSAbsaqtJ2C1aSVF/L7VDJv7uH6OORXeWvhyYkn8EQjTv KmIQ== X-Gm-Message-State: APjAAAVzTFpCX6S0PPPiZBxcBI+A/4Vwk/TpePY4xcCNMEOZrTq92J7M gVEThiNVbtNZdttVsthJf14gogSK X-Google-Smtp-Source: APXvYqw2ktqD2VFsWPouWdC8Z9JP58vjjwn5VzWhOajraw0kne7ljtWTNye434Nc4r+YnL1CiH7MDQ== X-Received: by 2002:a0c:ea27:: with SMTP id t7mr1085738qvp.103.1569271490489; Mon, 23 Sep 2019 13:44:50 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:21 -0300 Message-Id: <20190923204423.23824-10-danielhb413@gmail.com> In-Reply-To: <20190923204423.23824-1-danielhb413@gmail.com> References: <20190923204423.23824-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 23 Sep 2019 20:44:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 23 Sep 2019 20:44:51 +0000 (UTC) for IP:'209.85.160.179' DOMAIN:'mail-qt1-f179.google.com' HELO:'mail-qt1-f179.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.131 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS) 209.85.160.179 mail-qt1-f179.google.com 209.85.160.179 mail-qt1-f179.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 09/11] qemu_driver.c: use virConnectValidateURIPath() 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 23 Sep 2019 20:45:15 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Suggested-by: Cole Robinson Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f7f059b6d6..fe4d50c372 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1295,22 +1295,10 @@ static virDrvOpenStatus qemuConnectOpen(virConnectP= tr conn, return VIR_DRV_OPEN_ERROR; } =20 - if (virQEMUDriverIsPrivileged(qemu_driver)) { - if (STRNEQ(conn->uri->path, "/system") && - STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected QEMU URI path '%s', try qemu:///s= ystem"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } else { - if (STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected QEMU URI path '%s', try qemu:///s= ession"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } + if (!virConnectValidateURIPath(conn->uri->path, + "QEMU", + virQEMUDriverIsPrivileged(qemu_driver))) + return VIR_DRV_OPEN_ERROR; =20 if (virConnectOpenEnsureACL(conn) < 0) return VIR_DRV_OPEN_ERROR; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list