From nobody Sun Feb 8 04:11:13 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=1569509876; cv=none; d=zoho.com; s=zohoarc; b=cGIJIA5e8YcLZxHN+zfLvyS6FBzmBerK1LD47QJ8JUszZQuot/tqfW0R7O9fdu0vgOXDdjV5L0DlvMLXDkwpsq+zdYIvTPEDXlyRDfCAVrrAoRU0dBsvGXwGIZE1KH7g0jIX58JayBd+uXA4cFNnIheH1nZD/BoSxzqSLVIdkC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569509876; 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=iGGqYqe0GSflKIQAdrUbVqnjXmNY9oiwZh/8FEDxWyk=; b=JFDD/Ju3/tNakU3HLGykDT2vzszmwb99qv7QY7xNWgUqDM9MINOXyZNOjbOBH1zviqeju9PIK0cLcGxG4j5lLKYWj/OXouBl5c7asCJwevcAdC9dQh90DsUim9yhXSw9kIAbHUudVEaQLDdwRSEYar6DT5ASUpWDOT/ZC/RDtvQ= 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 1569509876720683.4852751481347; Thu, 26 Sep 2019 07:57:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23A1B51EE9; Thu, 26 Sep 2019 14:57:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE7E25C22C; Thu, 26 Sep 2019 14:57:54 +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 B03C51803518; Thu, 26 Sep 2019 14:57:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8QEvGlE028848 for ; Thu, 26 Sep 2019 10:57:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C8B95D9CD; Thu, 26 Sep 2019 14:57:16 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 490635D9C9; Thu, 26 Sep 2019 14:57:14 +0000 (UTC) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 9D4BD3078A3A; Thu, 26 Sep 2019 14:57:13 +0000 (UTC) Received: by mail-qt1-f171.google.com with SMTP id f7so3202679qtq.7; Thu, 26 Sep 2019 07:57:13 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 07:57:12 -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=pcdGgeP8TtY/8Oo0u8gyog8k9Aa3Ueh4CHSbjYlSAyM=; b=AnvFTYsxVZ1oU1eEbnhwk/+pLWK6Psseo5vBuOkzdK96x2YZK8otkxV1mcZ1eU8KXc a1RcpsWaYKI7NmRuH+em198NZrj9yymPIoOLpYE1RjMkgsfeLzZ74m6Ruj/8G5qp/Zzd uC337RiKLb0rr+cuwy6g5xF4NGbQBlwyXtF5WjmkGxbRNrYzh4rD749PgI7HUz0amu5P fT8Rmz9X1EMOTz4WTenhXoZwbfB5RZIwrXWJGa6aklLAVK5XUaOyxSTlWArloaNeUYkW a6sZcsTGSuI8RMUNPuO2QurSHisZI0Ar1JMQlsVIZtA9Z6rgToSqm1O8L8ZPN3u3cWJ2 4w9A== 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=pcdGgeP8TtY/8Oo0u8gyog8k9Aa3Ueh4CHSbjYlSAyM=; b=ubG+MBKhw6oiAbxSB/4oeseV2GwPTw0bkRs3O4R7WVqvHLjY9ZMPiAjAZh7UQJQyog RQVIV33jAjbcbQ53b/5Su5lhu42iA+sr6mxY+Qt9xJMZSyCar347Yy60OjoIYJvygksW TP4HbtUIw3CxqBX6pbVugTnVEHLcEenCds3WM15+I/Ck/ANUPTm8gobb7SrhYwHhobb/ VrzOXAvvKjx/WkVX17ZNwsYPKyLIgVc+iamU0l8mwG4v1U/TxMq2WHE6X0IP0TMRLR16 Thpm75xJ7BPe62Yl9x9vQfUDuSLV4/kaotGpLZidD15DnjZC+V5oCJinOY5loqZpuhRY vIcQ== X-Gm-Message-State: APjAAAUDbIAmoNtzQOLemQHURdxtvwcVbaKqEh6KaXuQnLDTbFgSVID/ 3IGVepxzexa5ssba5Abkc+DiDWQuiMk= X-Google-Smtp-Source: APXvYqz6ZdVniqmziJ9OUull9aIrLHRjEPyEyAwhaJHO0Ujq8UjfYvjeXhfN3o30qV1VERzrTQ1BLQ== X-Received: by 2002:ac8:41ca:: with SMTP id o10mr4218161qtm.352.1569509832672; Thu, 26 Sep 2019 07:57:12 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Thu, 26 Sep 2019 11:56:42 -0300 Message-Id: <20190926145647.3478-8-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.48]); Thu, 26 Sep 2019 14:57:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 26 Sep 2019 14:57:13 +0000 (UTC) for IP:'209.85.160.171' DOMAIN:'mail-qt1-f171.google.com' HELO:'mail-qt1-f171.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.15 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.160.171 mail-qt1-f171.google.com 209.85.160.171 mail-qt1-f171.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v4 07/12] storage_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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 26 Sep 2019 14:57:55 +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/storage/storage_driver.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index ce10b55ed0..d160ff34fe 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -411,21 +411,10 @@ storageConnectOpen(virConnectPtr conn, return VIR_DRV_OPEN_ERROR; } =20 - if (driver->privileged) { - if (STRNEQ(conn->uri->path, "/system")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected storage URI path '%s', try storag= e:///system"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } else { - if (STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected storage URI path '%s', try storag= e:///session"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } + if (!virConnectValidateURIPath(conn->uri->path, + "storage", + 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