From nobody Sun Feb 8 11:25:53 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=1569271493; cv=none; d=zoho.com; s=zohoarc; b=DQDfmnVooG5ZnzbylHfWm5EcuN/MA9aWVuAmPrmouFAnzjIZTIN/kraa+MqwBCFcaOUJQ5QhZUxICmiEpWhCobyg/XFlzLaXHAnSSRsKpjsV+Q2f+8LAMjqEWevqxz4PkoHGnYku3UXt71lbMrVz33uCzOl6kljAEW+ejBk3F0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271493; 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=p2+krng0JKFrbuQmoVADrgXLCVUyyZ2VHRM3iRYNeWQ=; b=GTXhdMizRa98kHlN64iksfYNOIeXhjZYD5J01pk94DNeo/NwLqJS5zdd66ZFZ6VFaDX7ItJJCjzvNEs8WMqbCxQXF6XYbM8FSgIjlipnXDkFHwcTPgSksIi2wEWcuX9PFh4938affJPzGV9UOx9JhkDhgX+1UZcSSqNcm4n5F88= 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 1569271493118186.86348309012112; Mon, 23 Sep 2019 13:44:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9EA8E305FC56; Mon, 23 Sep 2019 20:44:51 +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 18CB75C6CF; Mon, 23 Sep 2019 20:44:51 +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 ABA944E58C; Mon, 23 Sep 2019 20:44:50 +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 x8NKimr9031716 for ; Mon, 23 Sep 2019 16:44:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A3A1605AD; Mon, 23 Sep 2019 20:44:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx25.extmail.prod.ext.phx2.redhat.com [10.5.110.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3325F605B0; Mon, 23 Sep 2019 20:44:48 +0000 (UTC) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (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 7698F10C0941; Mon, 23 Sep 2019 20:44:47 +0000 (UTC) Received: by mail-qk1-f175.google.com with SMTP id w2so16973905qkf.2; Mon, 23 Sep 2019 13:44:47 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44:46 -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=40wZH2hs5BiqgK1rDcI8VLjlhb88medP/gEKtO2yEdc=; b=Ey0LDekqL/5IsNPafplsNd2ZVbxHoBHsuCiyA+Alz9sNmMLMZD0qWDLAfjBnVMbH3a MGiCqwlkwW44oAF58CXV8DUXUrKxyK/NWo3XmliBoXOk73Z0CIWVX8PPf5Ycq65k6RvS S9i4ohanLsZMR0fApv5D3BWx/qhOw4wwYQjFdCVDRppwHOEmQMGoe/mxhfCvfHaA9Gw5 FK5GK3srsnHQEk/ByH+x1I38S8c8M3t3jS6c545daOoJUauJUPkUGatWk3mqgqIpvS5w PJfx6QjRbccCCczd4dXltXYOVq2/9qEmP6HMlEnthi3SQbWqpJpvbQ6YhVqIdcK42psq 9JrQ== 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=40wZH2hs5BiqgK1rDcI8VLjlhb88medP/gEKtO2yEdc=; b=mlTI0jfAVp2Mi0Fzq7eitkw/iiYND22qCuncjA92Q4Ovi72Ar8en44A3Apo/B+tGYT VgnzGvpzK1J+DK9Ui3Sk8l/r9OnZrMeXjKyR+sVAmUMhpaIlg+ULaX+K9sn6tVfxxhup tEnAbieeUP4EWJHFONTL21vaLjXS3DDr2JFqLOjB+xCL3mwoWK8HqzqJQiV0LZl1veQm l5cFazDm7lKTNh/g6gmPX3nYvNggWjt1Zy4A6UejuwVIGRT7NKmFzfc36SqoeTC38dLo svadXNDsJrRZLJcJzmF5gs+QrNvqDyCTd4bxguxKyvPmAgrZA2oQpq70RxFUDsEMgL5w yazA== X-Gm-Message-State: APjAAAXTzOs7YYXgdj+Gg+1tsZOUDxmWTWkUeivMTp/uEsp8X8tiDVGm KMuuMaCElpPBlwpwwAvIVxxNbhmG X-Google-Smtp-Source: APXvYqwoNlXeEM4oiqCY//euOG5lO3Xxk+NP+PFUyui4k/qPGKsQ7xQkULBxWY/q5cSYPHOtHSUiKA== X-Received: by 2002:a05:620a:12b6:: with SMTP id x22mr1911160qki.495.1569271486689; Mon, 23 Sep 2019 13:44:46 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:19 -0300 Message-Id: <20190923204423.23824-8-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.6.2 (mx1.redhat.com [10.5.110.66]); Mon, 23 Sep 2019 20:44:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Mon, 23 Sep 2019 20:44:47 +0000 (UTC) for IP:'209.85.222.175' DOMAIN:'mail-qk1-f175.google.com' HELO:'mail-qk1-f175.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.222.175 mail-qk1-f175.google.com 209.85.222.175 mail-qk1-f175.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.66 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 07/11] 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 23 Sep 2019 20:44:52 +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 | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index ce10b55ed0..1bec2d964f 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -411,21 +411,8 @@ 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->pri= vileged)) + 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