From nobody Sun Feb 8 05:59:10 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=1569509859; cv=none; d=zoho.com; s=zohoarc; b=BtkgxrFE2BH2xIirfkdmp9oWGRlUeB1Ax98lgChrEWeBbhSiuIYa7Ouy68Y4bw2hWKMcW4KCqhopg/W74pXPBmu+LCOTytTpOBxb1iB17c1cK3FwtXT3pa4ApwHhoRLJEWXrnSDqUvB+kknBGRnaf+3SqLSC0EOjTap8d3YOIJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569509859; 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=o7kkfl6/KEUn1JpNYO0+OWu2DrJrCy2+I0db/l1s/CI=; b=Eyf9S9aCMXuEtsFfarOjZmSqUZ3eDXscVyOVha0Ub8KzTQrVDNEWSyJ8CmsVl4TSxQw6W/R4ZfDfKs6u/Q48dFdSXiJ9NAy9+TQQeQ37OdsrkntBFzYVzARDE/7XKDB5/ukDzWe1J9obrZBCT1dkmJ7V8GXmKwoK70tVF+CLFGc= 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 1569509859879395.72637588880536; Thu, 26 Sep 2019 07:57:39 -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 0A62D10C0954; Thu, 26 Sep 2019 14:57:37 +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 D746460C44; Thu, 26 Sep 2019 14:57:36 +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 99C67149F8; Thu, 26 Sep 2019 14:57:36 +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 x8QEvA3J028820 for ; Thu, 26 Sep 2019 10:57:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id D3AAE1C92C; Thu, 26 Sep 2019 14:57:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C715B196B2; Thu, 26 Sep 2019 14:57:10 +0000 (UTC) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 A1383C08C321; Thu, 26 Sep 2019 14:57:09 +0000 (UTC) Received: by mail-qt1-f180.google.com with SMTP id m15so3248158qtq.2; Thu, 26 Sep 2019 07:57:09 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:cd57:9a0c:bf:55c8:50dd]) by smtp.gmail.com with ESMTPSA id x12sm1346543qtb.32.2019.09.26.07.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 07:57:08 -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=Y+D1TcgVzIDnB5N1hzvWv6buMX6I0xmAAN3lRYFpKEQ=; b=ssxsdxq90Q3vL/JPektR8zYKPlPJxrCcn+oEidD5b1jVASMbKtz1tR/wO1pHBLl8mp M6SVOZjv2C8x+RCKxlOizAB7QQ69tEpjVQ77R/J0KAIAEk2NHPTi+2o0lLO3bV/2X7Jk zmuLlZpQm5dzQZs4OKNtpZViItAVGwFpZXTbsh8xLw60lHY+vdEXuXy9omheiiUQNfwY NenEU+0uqXv74KhV6bLBwrhgOuEzkVFKYzNZ4oAImHDlLqF39p6MbEdNKzyB4Ve0VOiy ozUShm/YkYbOQ+26pePlw2zp87OiyUQRqD+ZV4luXZR8SRTmn2HYy5AGMNxLgqQ1psO8 EGxA== 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=Y+D1TcgVzIDnB5N1hzvWv6buMX6I0xmAAN3lRYFpKEQ=; b=EkhMPRxkkFPHCAg8iVdjT8Gnw0++AqJ1Hmbetb1McEjR/PesyOx5zs69WlVwIw53pF Ay1lvwVbUrAsVceSbOBE0NvlSeHduxEJuP72IERMwKVCGPHgW7UAMWIa76rrEtBEBykh VuCPzKLrqalKg2lJRldywwncfV0Su9vO0Vh88c3ocOnkYkplRYJw4mptuFAm9NHZSxJX sbVlGiwWvgr8qRki43poR1tNRiCUdgRSfvFBvm+4+hayDFzAksDk1k3QwHKlIAl6YHNh 6R9Chf1U32RLWTzbZyL5lPFDEPuEwxV89AzaNgPpBx5728/LnLoZyDI424UUzKj/PVmN gwiQ== X-Gm-Message-State: APjAAAX/6aV4vAViW96BJfcjnkKxsjH7mLo5yuKUQMfmP07Pq/M1YtYm T3EWQ/F9lmxZuTQyiPqL1Q/Vw5EmXTQ= X-Google-Smtp-Source: APXvYqw82s8PBETBvDrwRqWjb4QGK/zxBAPQyOyqziDRB54zH27QK8L+QLOhUQUujJZlgamKsue3nw== X-Received: by 2002:ac8:53c3:: with SMTP id c3mr4216747qtq.273.1569509828869; Thu, 26 Sep 2019 07:57:08 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 11:56:40 -0300 Message-Id: <20190926145647.3478-6-danielhb413@gmail.com> In-Reply-To: <20190926145647.3478-1-danielhb413@gmail.com> References: <20190926145647.3478-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.31]); Thu, 26 Sep 2019 14:57:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 26 Sep 2019 14:57:09 +0000 (UTC) for IP:'209.85.160.180' DOMAIN:'mail-qt1-f180.google.com' HELO:'mail-qt1-f180.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.153 (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.180 mail-qt1-f180.google.com 209.85.160.180 mail-qt1-f180.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v4 05/12] node_device_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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Thu, 26 Sep 2019 14:57:37 +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/node_device/node_device_driver.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index 8fb00d0c86..578489c5be 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -58,21 +58,10 @@ nodeConnectOpen(virConnectPtr conn, return VIR_DRV_OPEN_ERROR; } =20 - if (driver->privileged) { - if (STRNEQ(conn->uri->path, "/system")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected nodedev URI path '%s', try nodede= v:///system"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } else { - if (STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected nodedev URI path '%s', try nodede= v:///session"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } + if (!virConnectValidateURIPath(conn->uri->path, + "nodedev", + driver->privileged)) + 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