From nobody Mon Apr 29 00:42:33 2024 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=1569419440; cv=none; d=zoho.com; s=zohoarc; b=jF5s4Dob53cMmtSPbhDRR+yOJAaeNkiUjx7BsdUGbNGKidOHBuJTVGlGOaLA7DA/lBDuI7hnjfw2IPTXCfTAcr6GknTCvonZBz6oxEl/Fp20hnFya1bLHThljWforpXMDTaLtNeNahr0DyBZtdJUk8RgU9ewOINlkNFvVD6mVk8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419440; 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=eIPWTa3n08tBHzKvD9soCPeKzZhJxZrjsgrXqMKGrSs=; b=Nf1c7fqDihGmwhdAgh+/sjbNc6TyxZcTCllYCNfUErg3T2HjWvIfABMNwxq3PN8HaLTvWHW5sHMNXh/FP46zqJYEb2OciBUbeCkFYFB8Y+ji6hSdSfWuVEhJWGdShnFVNexaCjO0qGtUufza8n6+CbVLMsYP2rDiXirQUQ96D7o= 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 1569419440696108.81837389349846; Wed, 25 Sep 2019 06:50:40 -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 0242B18C4296; Wed, 25 Sep 2019 13:50:38 +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 CEFED60461; Wed, 25 Sep 2019 13:50:37 +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 92763180B536; Wed, 25 Sep 2019 13:50:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8PDoXSD014064 for ; Wed, 25 Sep 2019 09:50:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 14B95100EBD3; Wed, 25 Sep 2019 13:50:33 +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 E4F4D10027B6; Wed, 25 Sep 2019 13:50:25 +0000 (UTC) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (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 1EECB3082149; Wed, 25 Sep 2019 13:50:24 +0000 (UTC) Received: by mail-qt1-f174.google.com with SMTP id u40so6603694qth.11; Wed, 25 Sep 2019 06:50:24 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:22 -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=enfxXZjLCTeP7EN75b5HshKjs9PkvkDRWgmCzmPiqX4=; b=gp00B1HD6as37cul6caK54A5DaLl54Tvq9bEqvVjJxCYA5eo6Y2PSmLGiCogLGHrOP 8qk6c1dkLjEzVnOdJMwa0L8s6ZrE/HGQoqTa6KI9pJq6wRkClJ8K9G7cU17/L2659JEv uAPkd5+Ha2LuvDBOr17NQbbWtaAYQ7AfkKjzC2ZWBxhp2gX0+qqVoP3Jh/KCIun4l2de F2gHs5ZJtB97jk+mhjTsm4BI7fst7s84+E8JW8xzyugSXOobe8QXMWX9dMxqNpvYWhRN 7MFEtiP3dsGzeLaFJna7bDppzkXCfFjT+K21FgWCNqW/e4TY8zLWg8wSSSzAtgsZ/OG/ 7HsA== 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=enfxXZjLCTeP7EN75b5HshKjs9PkvkDRWgmCzmPiqX4=; b=d+eTQDxM8d1eaLI4jSvvKFI4xi0DBIVHAP1MKmDwyBolydn4QguRYN9cuHHPWuA8jf Vg//kZqk65WzKXicslCLeOdlzSC7JSaO58bEbJeV9jZLT8RA24kR0RU8IHXlqoTK9bw4 RYU0oBl3KFpm7fxn6N7MKc3GiniKAbmL9oY/aqE+UlZIArUm99gWdhTK19r1AXTKp791 HK1xPiPnoQCV1WC6SD8zId0lBrOLfCp4ZCQuhoJqf4++jbot/Tq7LX+EZWbdurLigdL8 3NLYNRvAdby28Tkx0/zMTbkUT0vUxNKxoagprlfBfUeD7Qxw6/PgpYtpI6+PnCthuhG6 Ml3g== X-Gm-Message-State: APjAAAXIVDN9OjHzjnkcULXNhlspfMAqXmgYb/1NL19rW16bpVE+56uW HV0lmNxWe+ng15lfwDLWhICWM6HT X-Google-Smtp-Source: APXvYqxnF9Ur6dEO+LqjDdM5KRl3+R1mbP4O4+POynPsernF1hY4GfsfDLMDpY/CuA7nvZz2eJbw6A== X-Received: by 2002:ac8:1793:: with SMTP id o19mr8869430qtj.64.1569419423270; Wed, 25 Sep 2019 06:50:23 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:01 -0300 Message-Id: <20190925135011.5689-2-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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]); Wed, 25 Sep 2019 13:50:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 25 Sep 2019 13:50:24 +0000 (UTC) for IP:'209.85.160.174' DOMAIN:'mail-qt1-f174.google.com' HELO:'mail-qt1-f174.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.174 mail-qt1-f174.google.com 209.85.160.174 mail-qt1-f174.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 01/11] src/driver.c: add 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.6.2 (mx1.redhat.com [10.5.110.62]); Wed, 25 Sep 2019 13:50:38 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The code to validate the URI path is repeated across several files. This patch creates a common validation code to be used across all of them. Suggested-by: Cole Robinson Signed-off-by: Daniel Henrique Barboza --- src/driver.c | 24 ++++++++++++++++++++++++ src/driver.h | 4 ++++ src/libvirt_private.syms | 1 + 3 files changed, 29 insertions(+) diff --git a/src/driver.c b/src/driver.c index 5e8f68f6df..e627b0c1d7 100644 --- a/src/driver.c +++ b/src/driver.c @@ -269,3 +269,27 @@ virSetConnectStorage(virConnectPtr conn) VIR_DEBUG("Override storage connection with %p", conn); return virThreadLocalSet(&connectStorage, conn); } + +bool +virConnectValidateURIPath(const char *uriPath, + const char *entityName, + bool privileged) +{ + if (privileged) { + if (STRNEQ(uriPath, "/system")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected %s URI path '%s', try %s:///syste= m"), + entityName, uriPath, entityName); + return false; + } + } else { + if (STRNEQ(uriPath, "/session")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected %s URI path '%s', try %s:///sessi= on"), + entityName, uriPath, entityName); + return false; + } + } + + return true; +} diff --git a/src/driver.h b/src/driver.h index f7d667a03c..68c0004d86 100644 --- a/src/driver.h +++ b/src/driver.h @@ -127,3 +127,7 @@ int virSetConnectNWFilter(virConnectPtr conn); int virSetConnectNodeDev(virConnectPtr conn); int virSetConnectSecret(virConnectPtr conn); int virSetConnectStorage(virConnectPtr conn); + +bool virConnectValidateURIPath(const char *uriPath, + const char *entityName, + bool privileged); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 39812227aa..eb9c5c22ee 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1343,6 +1343,7 @@ virStreamClass; =20 =20 # driver.h +virConnectValidateURIPath; virGetConnectInterface; virGetConnectNetwork; virGetConnectNodeDev; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:42:33 2024 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=1569419453; cv=none; d=zoho.com; s=zohoarc; b=Zw8dinGQYfLWmrf1N+TiEkql/zGRYjZb/3djcA+VzZ5f4Ldu+co7C+tA/iLoN+oKs8P1Z8JhHNkz4hIjtYHI8AcCvJyaNnaz3OFDy2TCeckz/Pol1spycdoRSAKpHeYYx6Cf0UsPQnGZMLh94ZyuAJDZ2ICh7BkdZF+YXH5S6g4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419453; 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=wBMPq6dzqqEESTVtewBvR9uoxsELcKhivmIrw3ZzSLE=; b=mEV4uKO4w1MyAbCMhDYwAacP9gku41G/5sr0nO9M/spZX/HK5vUm1EeBiN1mtAsd9TIJWJucfy+KetzMt9NQZh4plderp+qC252wYjXal3Xd++JCMtOHawmTuCS/j2liGsGWuM+wRzEvbJui3J4y/dtPrPiA9ewiJkclRO8sxxM= 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 1569419453058917.2080110721271; Wed, 25 Sep 2019 06:50: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 6925365F4B; Wed, 25 Sep 2019 13:50:51 +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 350B160566; Wed, 25 Sep 2019 13:50: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 E4441180B76F; Wed, 25 Sep 2019 13:50:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8PDocih014115 for ; Wed, 25 Sep 2019 09:50:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id C23D360619; Wed, 25 Sep 2019 13:50:38 +0000 (UTC) Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95EB55F7DC; Wed, 25 Sep 2019 13:50:27 +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 4692930BBE64; Wed, 25 Sep 2019 13:50:26 +0000 (UTC) Received: by mail-qt1-f180.google.com with SMTP id c3so6602407qtv.10; Wed, 25 Sep 2019 06:50:26 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:25 -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=X+NOx6HC2b3mekPEbdmC259c4dIepBAqtxfcGRibP/s=; b=DJONJnoA/B0InwUCdP8R8ukNkp5/mZVmA1U/YXFWTutZw0+4LChMpBA+UBp6KygC3+ WIeZRiEHZU/D44RmG1E+X5ibbSDE+lGnZSSk7CY3UCWfwouxseWRVRuBk/msDXVIlhDE OFPHLB1naVZI9CFTo7ytMKeYEH3GgsohVFNrie9OsAF5iQ4qmYFN0QGhkkoH6z/JfNnX Y5GFbzL0aghpFv0fit7l8i43gHUg+HuyB0KO9DX3CASRv8xO4sYO0M+oIa7TM+KeHwQ0 zNeL+PZl1xNVaOiKV7BQDpL3+TBCTB9GaCJzPeQ7E1Ol+n4D7GpMbD8krViXK0Q3FP+S eopQ== 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=X+NOx6HC2b3mekPEbdmC259c4dIepBAqtxfcGRibP/s=; b=fbz+ygIvt+9qsIHso8tVXXW4e+UyFTtK0YJ8hP8mHT89137NJYnXOEYh8jBRpglpbz F++rYLUtzw0B4+SNA5aqo0BIfNS8k/gaz15jOVX3321FSCbFr8IAQqv/Z/7tC88tKTCb ib1TPmxUhQeatbQvWjKh/I4GgRArsCPI6LeqMdrhOuZtr0Zqz0z8WJO2lTwJYIZN4W0J CYhPazr15Dl9VKmj/dpo8Frk33glrrjU84dz9RFH3T+sQqpsdPw2jp8FtbfmmD4qejT6 r9ccAjNLKdaqRhP5gS8bP6SFtlOJZzVssI0dgcxlj2XtnB7IKskKOF3qCg1T6/NbtGg5 r+GA== X-Gm-Message-State: APjAAAUrkj5lyeMT9rFSs3+DR03ODAYPZUsowUIdrXVM6DouJU7Nvbku gTLTmDBZESpIWfbuKdHWZZ/tOtga X-Google-Smtp-Source: APXvYqwZwnzxt400BB9GSCu+y3eZ9t8Z/y/0rwJrYAiuUPzc0PdGv/ZX9IyZMX25kNets/LlyzbzdQ== X-Received: by 2002:ac8:c01:: with SMTP id k1mr8600042qti.59.1569419425492; Wed, 25 Sep 2019 06:50:25 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:02 -0300 Message-Id: <20190925135011.5689-3-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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.49]); Wed, 25 Sep 2019 13:50:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 25 Sep 2019 13:50:26 +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.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 02/11] interface_backend_netcf.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.25]); Wed, 25 Sep 2019 13:50: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/interface/interface_backend_netcf.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interf= ace_backend_netcf.c index 9659e9fcf1..5ef8ac33db 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -200,21 +200,10 @@ netcfConnectOpen(virConnectPtr conn, return VIR_DRV_OPEN_ERROR; } =20 - if (driver->privileged) { - if (STRNEQ(conn->uri->path, "/system")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected interface URI path '%s', try inte= rface:///system"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } else { - if (STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected interface URI path '%s', try inte= rface:///session"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } + if (!virConnectValidateURIPath(conn->uri->path, + "interface", + 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 From nobody Mon Apr 29 00:42:33 2024 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=1569419443; cv=none; d=zoho.com; s=zohoarc; b=f82z5XfRKI5H0mhCVM3JfVpwIEtS0lx3eEjw29izk9gDl+U9XMNyutP0kx0CjLvk6KuUzaYAs+38FCUGZdPjvnjROI6Zw8glzbVTw7Tpgpi1ai4Xu9AMhYdPW0ZNdhMXLhO5OeD4SyqGwMJrLkse9wVBqsjhJA0zSXnekHGBNXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419443; 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=e6PwcySTplA9bAdenEBDULkrJscbY0QhWhOfLb9WVGA=; b=C7+bXnbo1P6P+QW8hAG6COwrVqoKqxASms5ztf1hjQ/kUiNekj1KRdBhfBj+IeOXHZD1Q8miX1htP/JClktBE7IRAiY6ypFrC4Yd1eu2MD+jDfRV02gBdnE4d1XOK3JXD0XERbxHrQtAV+f9s777l4+i0Lb+u4l+sG3OrvHiN54= 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 1569419443933175.4107340125869; Wed, 25 Sep 2019 06:50:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EE1A510CC207; Wed, 25 Sep 2019 13:50:41 +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 A899261F44; Wed, 25 Sep 2019 13:50:41 +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 5140C4EDA5; Wed, 25 Sep 2019 13:50:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8PDoZMe014088 for ; Wed, 25 Sep 2019 09:50:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7141D100EBD7; Wed, 25 Sep 2019 13:50:35 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0565F10027A6; Wed, 25 Sep 2019 13:50:29 +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 0A194C05AA56; Wed, 25 Sep 2019 13:50:28 +0000 (UTC) Received: by mail-qt1-f180.google.com with SMTP id u22so6599286qtq.13; Wed, 25 Sep 2019 06:50:27 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:26 -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=aNPJJ2nW1CmnhkDYHPJ7o2UA2mfUo2uHBlOXnr2X52g=; b=iM0XOpM0Q/eGFAiCOH89W9XOgHX8Hr4R/rpExD7OX7u+VCw5pPK7/WV5D93ZaZ8BsQ 9xT3MXLUueGNMOat9muSYdUQVgdZz/FzgzYK6qbk24rMOlzUp9XTS+pINvXTMY7DspdE 6E3a46JjFn9PXDGhnuQrfTXAWDUo6tbC5JfyS6p3fjYZRpF1N7CFZpFj6LXV2loAcS4x k5ZGkF3SeYuxYUIOcgX6Xb1FpywsSlou/65jyf8X+X6Lc4o5AB4wFOxQteQLJKAr4zm+ XY3LSV5DRUjGhUmqTEy2EgHn/C3U+vxRdGFMjfYO9NumQ2XubppbqDvXYKL+CqAEcmam DiGw== 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=aNPJJ2nW1CmnhkDYHPJ7o2UA2mfUo2uHBlOXnr2X52g=; b=NGVk8dZ1ClzZOO4M+wH6zEY+E68TfjiViMbNC6vodFiUXdz9Kt4mABXd4fPKUHWlp/ ah3w7MOaEct5q6TkCtE8zUJlPgUNXC21XGzoIDJxgBMgwB/ZZvs+AGkaTJ9OKynGiQxe /UaCC2/5/g2oTiFCo0Jv17u4azPN7v1fXtLzP2z0Z3MPWE63rarMwzmJ/U2f/Po7uK9n ni4UincDs1DPFWOpvSkmstQhZ7QfRheCpKXmzWRN5p+mHw28S6HwE5c7riD0Mj7yDni0 9zUJVfRZ/0uCRs6NhCz9k9bv8cy2fqmscH9vaqp2KwLQmkdon3K9e/9Po0sdXBSeMFGW Y90Q== X-Gm-Message-State: APjAAAUciJWTwddgfq7Oxkhao1Ux8x97B0bJXyirlGoI55Xra+9DxUQ+ DiMjCTyaOhjBoxT1UHtEZBTdrRv+ X-Google-Smtp-Source: APXvYqzlUBTYClIzPkJqa5FoiV5vqxoC994v0RP3Jw+I4wX6D2Z7hfHEXcUKVQ8Sjsul03RxgSay1g== X-Received: by 2002:ac8:37cb:: with SMTP id e11mr9058958qtc.22.1569419427207; Wed, 25 Sep 2019 06:50:27 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:03 -0300 Message-Id: <20190925135011.5689-4-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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.32]); Wed, 25 Sep 2019 13:50:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 25 Sep 2019 13:50:28 +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.32 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 03/11] interface_backend_udev.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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Wed, 25 Sep 2019 13:50:42 +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/interface/interface_backend_udev.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/interface/interface_backend_udev.c b/src/interface/interfa= ce_backend_udev.c index ddc3de5347..1684b8ed83 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -1250,21 +1250,10 @@ udevConnectOpen(virConnectPtr conn, return VIR_DRV_OPEN_ERROR; } =20 - if (driver->privileged) { - if (STRNEQ(conn->uri->path, "/system")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected interface URI path '%s', try inte= rface:///system"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } else { - if (STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected interface URI path '%s', try inte= rface:///session"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } + if (!virConnectValidateURIPath(conn->uri->path, + "interface", + 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 From nobody Mon Apr 29 00:42:33 2024 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=1569419445; cv=none; d=zoho.com; s=zohoarc; b=f+TSLCoSeViS7hZaWbXKD+xbV/IIjo4YLzdb8bLVROOoEUSbfgLE5KiDgSrNwE80xIYx64MhFHTbNtEMMSXVDhhCPhDBxLdRlqWHIPHhQ2WLYFNMRIWKsLC3rIkoWfrwp4pwAvJhoyxVKsPQZgduYFRE8EsDa4dWpiFJ9cp+YIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419445; 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=FWbHi1HWkC+gNzece05Dpek3kY294OOKK0EF/fCPpXA=; b=Y97NxskgXD5cLGQZTikzzVdmz07XdX70sqTcbVowDdueBYsCW5f5z7ikPdj1YFgVBbr3OxfJ+ZfSJrplNWjm06iT66hW5KFBpVqB6MxTGfJayYmZVT4dVsqcsH0F8XsrLVnlc5N5aDMzFk5ZIaB4IOjdo4++8H5f3gFL6Lpw2RI= 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 1569419445849527.2421902773299; Wed, 25 Sep 2019 06:50:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B02B898119; Wed, 25 Sep 2019 13:50:44 +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 10757544E7; Wed, 25 Sep 2019 13:50:44 +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 B3370180B76F; Wed, 25 Sep 2019 13:50:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8PDoZak014087 for ; Wed, 25 Sep 2019 09:50:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 70782100EBD4; Wed, 25 Sep 2019 13:50:35 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 05AB810027C5; Wed, 25 Sep 2019 13:50:30 +0000 (UTC) Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (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 B3CDDC059758; Wed, 25 Sep 2019 13:50:29 +0000 (UTC) Received: by mail-qt1-f182.google.com with SMTP id c3so6602667qtv.10; Wed, 25 Sep 2019 06:50:29 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:28 -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=MdwUhcEZaamVOHXrzW/zyFZIP1ktgOilvenvwCcgh88=; b=QXjTsX6AR1kvrtLismjmGdqeTH9oRSeSgtJMv2vsNUQ4Rbcpzv51r/LkDdGz+ezjV2 KFaawpkU6h52CmCskihmc1jqI3BY/Ff8XoZ+f6KRZXMZv2n43glS3+AePNqphAC/1lf7 AY/h0cb70xllqlw9YQMAojWpEB4VPcXhYJ3cbMaUjDZ9Phsh/zRneeoZK4DDb/kCiqxK rObyfb61y5NMspV4KWbJu7GXcytBKtGkAVxhkwVz0hvLKCtrFkHj0uKAl6bSSXQxXPv9 53XtUzDZqaikaLB63hp2apwu0xH34G+h1SCqxAx+klcelk5VdWNlAUgFeaF5fJV1H6VY Lzfg== 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=MdwUhcEZaamVOHXrzW/zyFZIP1ktgOilvenvwCcgh88=; b=RCIaDFk0lDWA11/Sa05k6UqsejL3cXRwyMqAH4bDL85fh8TycuDQvHp91ALczURPrY /KoHpxEMYHA9JSVEiMgw5LdcR8hW1b/iOdb9uNyjaTb7Hiw8OZCIBGHVU/pVdbB6OlNl PhH+VU9unmyT9SGZCjkedzisOGOSBJsJMuOTF8ut7kK4yxIj2BdrpH/DJZsaycdtQCVX sBavhnxlB/9mDFDiElZg/HA1VHl/+SNi/X469R2Xas99qK3puH+X/EECbNpD4oxCo4QO qFq5BqneW7fnjvn6Wsce1KqDgLIYpJp+iQzOJXngnWGuf6mYaP9IpQIsYGx2osroNOPq fFBQ== X-Gm-Message-State: APjAAAV+XoYstetnvbTJHUDKHeNkzZbjzA2fpbBi3CHPkVkf9EXLejB9 GO29rdPuisjgLAkEQMtj7N8VKrJ0 X-Google-Smtp-Source: APXvYqyhFfFJUUyu65RmnYTfVE2+qRdbiTTqozEPJt7Gkjnwg7Zb7+lKgEkOF9kIehWaUNr4/jMAdw== X-Received: by 2002:ac8:100b:: with SMTP id z11mr9172963qti.377.1569419428942; Wed, 25 Sep 2019 06:50:28 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:04 -0300 Message-Id: <20190925135011.5689-5-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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.32]); Wed, 25 Sep 2019 13:50:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 25 Sep 2019 13:50:29 +0000 (UTC) for IP:'209.85.160.182' DOMAIN:'mail-qt1-f182.google.com' HELO:'mail-qt1-f182.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.182 mail-qt1-f182.google.com 209.85.160.182 mail-qt1-f182.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 04/11] bridge_driver.c: 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Wed, 25 Sep 2019 13:50:44 +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/network/bridge_driver.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index c54be96407..c617bbb58f 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -938,21 +938,10 @@ networkConnectOpen(virConnectPtr conn, return VIR_DRV_OPEN_ERROR; } =20 - if (network_driver->privileged) { - if (STRNEQ(conn->uri->path, "/system")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected network URI path '%s', try networ= k:///system"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } else { - if (STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected network URI path '%s', try networ= k:///session"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } + if (!virConnectValidateURIPath(conn->uri->path, + "network", + network_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 From nobody Mon Apr 29 00:42:33 2024 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=1569419438; cv=none; d=zoho.com; s=zohoarc; b=hLPI4abCaBxiIwUHH/dHJraPUU3XQSg59MtP52XX9ztI+tw7UYuQQKBtaAceR385YshpSE31TXyu261mD/k+pNcXhEhROubldlsVZCNfX1VMqes+AvEwJoR9gGttdLH9tI4AfTlXOPAVlTnvGB8e2NuiE6nikAP5VnsDGl7eYD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419438; 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=Xs2HFeg4Nk/Nu90Gwfhk3inBjk46Jx5lCl8g4KDRPGGGKUbyzRXSTJC4waFXI0PtIUw3JHZsw9xUiHZ52s64QxflWmSUUVX15ljUusg6iysGmblWHa2oJdCqx0tqvgGbZN4MZQrFdZ47EU+RnYO2H4BzbFi2m5teIiUSjPHQlSE= 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 1569419438654212.93470153223325; Wed, 25 Sep 2019 06:50:38 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F0AF2A09A1; Wed, 25 Sep 2019 13:50:36 +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 13AE261F3E; Wed, 25 Sep 2019 13:50: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 B856D18005A0; Wed, 25 Sep 2019 13:50:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8PDoX8T014072 for ; Wed, 25 Sep 2019 09:50:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 834D260E3E; Wed, 25 Sep 2019 13:50:33 +0000 (UTC) Received: from mx1.redhat.com (ext-mx28.extmail.prod.ext.phx2.redhat.com [10.5.110.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7958F60F87; Wed, 25 Sep 2019 13:50:33 +0000 (UTC) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (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 89FDD8A1C9A; Wed, 25 Sep 2019 13:50:31 +0000 (UTC) Received: by mail-qt1-f173.google.com with SMTP id o12so6631174qtf.3; Wed, 25 Sep 2019 06:50:31 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:30 -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=UB+myZSOWu7sH8r94voJ3luLQMiM+QrLzj5LQfZXEMJ3w8wCyl8aCA6ybRO/6Hl0/I qkWSZkogz2Wmm4x2+rfgNTq5pKJ6bwuYtVRU6514HCkrtHbIN7Zr/rNHmGdxn0pq+gGN rNTRCwwsluHcmLiosId6SeM4kflgr2omz+0AO1TY1M8+MuANq8q9UHgSn8xfYAbZauIC yBGQIrRm+7oCYiHwrwUr1U59QKcGnZPaCCTd7ZRJOEavUoXc7ac9V8TyBsZuzLaIBXQI GrlyfKxKXBYnaSYQRSrooGzcjDw6Ovfdt4RvwOk+7e7VNWZbiZIrEpOisCWEvpHr6/6l kOxQ== 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=lVHgdttMZ9McDFtXke9qouIMYyjqX6tC54Bkv2lckya3CN+pGY2u3lCGXcPJvM0Ta7 65XXW2GPJfpSr6+PYyq7jQp3/EeoMsFbm3HpDkUXgpAEYurrFnpAbbZGGH2YoYtwNWnI j0XQ77ZWxuADEpuE83yUfFB8LbBKDA8Xg5rrizwss+zH0dg3x3vqTzCZnjG2scsqKqHw qjGGnKI8faSjFBzYZJkIWSdMPqoIJ38gV1kdD5e3nefPEEAwApdBhljFRDkbCbT95Ko8 AsWEa/NWBQI5Iz8EcDrUEKD2VKPbfgmAdJwoW0ts/3y6XwnvlvvpMRncYiuNMJlxtsrt SnjQ== X-Gm-Message-State: APjAAAXilIL0R4qr0yKuM0Hvtj8dCYx75Ltifvxq8awHgRWb/MvUOU8C TltByOQok4IDz+olngrZyTI27us1 X-Google-Smtp-Source: APXvYqxjnTB+oVADOF08E0DirYftp6e7jfgvOX/qavewrVDo0l3g6Nw3w9NGB4p4msmTkHJeJZ/7UQ== X-Received: by 2002:ac8:3a24:: with SMTP id w33mr8707287qte.254.1569419430762; Wed, 25 Sep 2019 06:50:30 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:05 -0300 Message-Id: <20190925135011.5689-6-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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.69]); Wed, 25 Sep 2019 13:50:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Wed, 25 Sep 2019 13:50:31 +0000 (UTC) for IP:'209.85.160.173' DOMAIN:'mail-qt1-f173.google.com' HELO:'mail-qt1-f173.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.173 mail-qt1-f173.google.com 209.85.160.173 mail-qt1-f173.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.69 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 05/11] 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 25 Sep 2019 13:50:36 +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 From nobody Mon Apr 29 00:42:33 2024 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=1569419442; cv=none; d=zoho.com; s=zohoarc; b=ko4bq/I7Q8USdgNvAE5xxrhXECbpWYnJb/J7ridedY/12Q7dnhxdUPKt+5JI4iKmgHkkbU/rCCW0KsGFFJAfRM1naoxi+wb1C8uL+rZCi0QVBdD9pDonlQ8eOZ6xdsms5zadleenn0JSpyK8yh3VPdnqzoO+d4s+vpN0QbFlEv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419442; 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=9wvoqlVr1WauJHXITZYemGaTgWR5pdM0V3Ofbm3gefM=; b=c938RWOJ5CxGhU/HCQbgO/tWft05OP3dGOCnacTwUaUfDr1MkYOh7RLJjfsH9+/pE40fdx7/yIANTJiHc6QOrZyBehCm7dIk+qWhUOA7lYisvAUY9O9QyWGmZuI2PMA/u3YiwZCEqJLp5G//llR0R670uIwYJIkP6hI5MyzhxLg= 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 1569419442402879.0044333791764; Wed, 25 Sep 2019 06:50:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7FD673CA20; Wed, 25 Sep 2019 13:50:40 +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 26B8E61F43; Wed, 25 Sep 2019 13:50:40 +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 D2D67180B536; Wed, 25 Sep 2019 13:50:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8PDoYcA014082 for ; Wed, 25 Sep 2019 09:50:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id BE73060619; Wed, 25 Sep 2019 13:50:34 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 33F3060A97; Wed, 25 Sep 2019 13:50:34 +0000 (UTC) Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 8F6FE309DEE4; Wed, 25 Sep 2019 13:50:33 +0000 (UTC) Received: by mail-qk1-f173.google.com with SMTP id y189so5322076qkc.3; Wed, 25 Sep 2019 06:50:33 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:32 -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=+ZuapLMy6DwB4tMQxPFSqg+x78BNIak0EuVFqMCNH/Y=; b=uFcBEwhIboFiiaqkOijBE/W8bd/bM6NSwgKAp7hYZBj9saCxVEyGkro05WQaRPZu8s Uzcfl4HZpozx+1FtejTjgkrerW5Z4HVwCw6Rii0UROrhSHlNNtYODk5m2DnVGUbPCaCn Bp9l2ySDps7a09VfO0hd/ekaS8SGpZRIC9sATczIz0GVpkdLzZoRJADF2Lm0OmMTt1M2 LPIRfNmalOZuTHNsFYtr2Ic15eU0KdvPc3L+8oVrKdSA0ix0QlvhE+A1vwuxp7wyLm5J TwmdyD8q6rwO66UooPApzkE58O52Gqlw6A64ioRBjXl+6qDABzh1oEfjVPW4U0t5GCue zk0A== 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=+ZuapLMy6DwB4tMQxPFSqg+x78BNIak0EuVFqMCNH/Y=; b=ed8FY0KZ0JUc9zc8nuAYSzGra82K4TPtHkFUBNIEAQKWO08RSCyE9UzVxpJZE9ciPy aVGt97ByDZA0aILLuWqgdtPr4/Piiqggeo4t4NGipDKAPS7r38g/taSiE6wvzBK+pH+5 e7IR46BF8l1eLwud4nAXdzLAk3x3Sdk3uGzbGzc5Ry++Ih55ren/q2N+/437yWdmVj0a o+GAhycDXgFKYSopoKY0uzxzWtRREbFxzjhlB2wInRmwws3l5TdsQeGIy43GMLgvfbwm rDHVHuEq0sOVkKDhbpvEJRFnKjbP2qoqJFWmuKY5BdFPrdO6yxBCH0xcqTcbGIMUPIV/ zaow== X-Gm-Message-State: APjAAAX+P5iAvpsLbnfrGEXCj4hZSIsXW5BOS6mzjCdVK1QXRTeKS53d WgeGVCVzIbUjgKC0TsRGDmA5g+AW X-Google-Smtp-Source: APXvYqxodMv6Nyo+AQTCD0FMvH4woSSJCGiYXrd7MRbSgkZVVSixevVD6bESv3i+ffEOTitLOqUbLA== X-Received: by 2002:a37:8cc3:: with SMTP id o186mr3762188qkd.186.1569419432666; Wed, 25 Sep 2019 06:50:32 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:06 -0300 Message-Id: <20190925135011.5689-7-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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.45]); Wed, 25 Sep 2019 13:50:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 25 Sep 2019 13:50:33 +0000 (UTC) for IP:'209.85.222.173' DOMAIN:'mail-qk1-f173.google.com' HELO:'mail-qk1-f173.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.151 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.222.173 mail-qk1-f173.google.com 209.85.222.173 mail-qk1-f173.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 06/11] secret_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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 25 Sep 2019 13:50:41 +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/secret/secret_driver.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 7512a51c74..ed3bd3c751 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -552,21 +552,10 @@ secretConnectOpen(virConnectPtr conn, return VIR_DRV_OPEN_ERROR; } =20 - if (driver->privileged) { - if (STRNEQ(conn->uri->path, "/system")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected secret URI path '%s', try secret:= ///system"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } else { - if (STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected secret URI path '%s', try secret:= ///session"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } + if (!virConnectValidateURIPath(conn->uri->path, + "secret", + 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 From nobody Mon Apr 29 00:42:33 2024 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=1569419449; cv=none; d=zoho.com; s=zohoarc; b=BrZ1xoUHsd87gdJI1dUMjk3FghRjM/BV/+NzJs4ci8cuv0ChvPZbHJxH5Z25oiJTAGMVVoquc9TWiKYqOBRU2xlmMXz1bNX9GvDr91G9Fk6vNDzwoT/4du16v2apm5+l8cnMe6PAgdWXeaspaE3a5YyBjGtYxHjG7kgT3DsMwvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419449; 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=CJkrs/cB7caLeC8tEMHnCpCMBfzrxidL1U7cSL7MgB2a5okZPNUx1u+f+CiQ+wG3PeaLj1n0wizMctM55QXXp8YZxHgEvGGWFj5lhhM3JBb/kXTFsq/fVR1Jl1m8ljm0Bj6vuPr58ahbvOWny+rj96+VazFyjYhbp4yTfn9XoIc= 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 1569419449392687.755626516379; Wed, 25 Sep 2019 06:50:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D94C6316D8C2; Wed, 25 Sep 2019 13:50:47 +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 A426262A7C; Wed, 25 Sep 2019 13:50:47 +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 5CC9A18037CA; Wed, 25 Sep 2019 13:50:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8PDobB6014104 for ; Wed, 25 Sep 2019 09:50:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 16C4A60F88; Wed, 25 Sep 2019 13:50:37 +0000 (UTC) Received: from mx1.redhat.com (ext-mx27.extmail.prod.ext.phx2.redhat.com [10.5.110.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CC1A60C5D; Wed, 25 Sep 2019 13:50:37 +0000 (UTC) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 E97E3A2667C; Wed, 25 Sep 2019 13:50:35 +0000 (UTC) Received: by mail-qk1-f170.google.com with SMTP id u186so5304831qkc.5; Wed, 25 Sep 2019 06:50:35 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:34 -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=nJ5GqSDVagVivTweEufFidDvhvAeNNMxbbZf72S2b4D/KzdRk3Vxd93Md73GK5r456 LsleGS6nKce9O7neYlSbKi0UTXxLhgGpf25LWEVDtC7yJFEGK0kPUEgfDta8LdTrNOXT rvjFTIZ8jl09B6jIvJdtxLL6qV0B/nMTkEsH+6M2s1AauiV7rXWDBmm2x9be2J54Owbq NiI8FTBrY8DjPjWeFdeF7aBJcBk6I4Cn5E7Eox3ow/cnC/pV3liNlzwF+TJqOT1yHWST D4RmLko95k93OvlFAiDAI/z2dHZcElKzhS3VcJUL4sAqOf8+vhLpsQnkkeo9JHXP6mN4 Cd5g== 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=XG432F9bYhSPvukt38ezy5rXs+qlHQfk5EPt2rgpPviv8DTLCyBOIw3YtTJ5JOUY6I Hqzc/pDXW7IZaWcTzVdigAi/WlOQoVtjdmET5L6oMFgjNmkhYUW06rRTDf4hXphypMkH vcVeJc7iNB4IvDgnUh+yKzvnPMtCPUHkKOlOu1tdWtMxpnFXCmMsRn7nQo+f016JJjrb SLPP46FXvhE6m4NVzffXBfpkeUYOyfpIkmLgQ2UPhim8MwBQqp7b7qTcj1BmUOZPsBFk ZrksjgmmbD9Xb7iX+zMsb75U655KFsWmy2IQ7gKlj185baWbCNwGN3M0ab1zsfRmPWvD S3+Q== X-Gm-Message-State: APjAAAV2Hg0KbQH2v13gqGphTp3vpTqk6CQ9jZq3XQeqr8l0lywioFXp wzTu9egYSfgW64WRy47adT7TJNKe X-Google-Smtp-Source: APXvYqwj5R8mzjc1peKqwZGpQoYdXn1bKmmkE58y4bzdby0VSMbnubwgZCrabIc5j7jJMizxp1LoWg== X-Received: by 2002:a37:a842:: with SMTP id r63mr3702015qke.34.1569419434820; Wed, 25 Sep 2019 06:50:34 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:07 -0300 Message-Id: <20190925135011.5689-8-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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.68]); Wed, 25 Sep 2019 13:50:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Wed, 25 Sep 2019 13:50:36 +0000 (UTC) for IP:'209.85.222.170' DOMAIN:'mail-qk1-f170.google.com' HELO:'mail-qk1-f170.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.170 mail-qk1-f170.google.com 209.85.222.170 mail-qk1-f170.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.68 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 25 Sep 2019 13:50:48 +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 From nobody Mon Apr 29 00:42:33 2024 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=1569419454; cv=none; d=zoho.com; s=zohoarc; b=kZsQQM6Ty0AXTRUaaI2tWAGNhVuxT1C6m9PdOVtXAkGRCmZGD6e0kcqyr4bJCktQR35SR6LZx6thGeuksnZeUP3I9xQu0ogAmk8nrMaAyjRrOo1107ZeVkdj3epj1O8yOUlNQgXEef3pZBYV9PEcGJYFydwpcKq60XucE4x2Hxg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419454; 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=leeGbcrmTs2N825Uvl+GrjZgrO5beUR41oi5y61QdFA=; b=nv1NLugSv9aL3dAkAVf57/fEvhJMJoeXvC+dssoHos9LIyF9BY23PhT1PQB7K3DCYyLA5Fwb0wgSVM0oph2gxCrCzL/aVp+B29RkPCbHmvJIpWpoBnC3dEK+wd6TwV8E0o/rUFfUh39735VU9VMNfKjhrCsGFGTWx182XdRo1n0= 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 1569419454844251.94076485669575; Wed, 25 Sep 2019 06:50:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D9A72109; Wed, 25 Sep 2019 13:50:53 +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 058AF61F24; Wed, 25 Sep 2019 13:50:53 +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 B38CC180BA9A; Wed, 25 Sep 2019 13:50:52 +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 x8PDopIU014201 for ; Wed, 25 Sep 2019 09:50:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 257C45DD6D; Wed, 25 Sep 2019 13:50:51 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A27F5DC1B; Wed, 25 Sep 2019 13:50:38 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (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 E0DFE793CC; Wed, 25 Sep 2019 13:50:37 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id q203so5309731qke.1; Wed, 25 Sep 2019 06:50:37 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:36 -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=kwUqt6IBui14TlgQ3hkk3XA3/2MX6M7ySuv8KI38AZo=; b=jvMCVUv2i5RqqR51SitHNDslliqVRfCLr+4na/gkYFSfeHHjbGGr7m3F1ckAhMU9/b UuOSCNlKfSJaPzvqRQ5QjNLRXzY4fT7Kkk1i40D/Ykb1OTV61mSNYHau+NNUp6ftISJm dUs4Y7XQmbsBnXqgayEkqAmgdL1VhT48LDGVJPwv1u45FWEcEcQ4CQFM5WXJWTNeA1vW RR/wGrnjdyi2OPhSNtQJFcC/ztSBrzF4bTrWxq8PUSrYE5ApSVkAQb6WopYkTsVATXad EjG2hJSd9T17oqYNnKYJ9qXUW0Aucufi7WOK3vY6gJzoHl7kv9BG6Z0SreH4Ln0hnTvx FDdA== 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=kwUqt6IBui14TlgQ3hkk3XA3/2MX6M7ySuv8KI38AZo=; b=p4dRfKsBGMveVCFw2Hb4AyPwMj4QybmTO7mC/mJCjZA0JYUIKFqtpsVAZkKOBIFHJ9 l3mPXst/SyUzmNNkSAp8kqgt3eAXQ+iZU7L6dsFHPc10SJXUMNq2D/e+ChqlFDuPdXkO KynXB/qFSEAZb2aEq1cL5Nx/UJj4taf28StbRMadjWUEShO/FFm/naX5Ho8yn70Bvpx0 E77JcAuTGqaTKzGFRD7rX7/Xhhm3uSXqC+U9nW3tvKaTdTZBYVYwrcaH+HH+ALUzpWfh RZzwnxARj2bmu+q2gQqMbuiX8U+LHFAOuw40yYdugTdk5nDvXitZB8mD98pa7rVZYVsh I6Uw== X-Gm-Message-State: APjAAAUtV30XDBzMQ1AD74enSJv6kcUMKmh5zAuMHDPDKsTD7MzZU4jC S5cQwrbZVkbAVsa4LwA4482uUkdF X-Google-Smtp-Source: APXvYqxrZ/ydOveG0rg1cIAtoBrjpz9IipIgv/aMEBST1pCnojqd3hhkospcIOJiIzmpF+ZMwDKiYw== X-Received: by 2002:a37:c14:: with SMTP id 20mr3563309qkm.291.1569419437014; Wed, 25 Sep 2019 06:50:37 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:08 -0300 Message-Id: <20190925135011.5689-9-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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.25]); Wed, 25 Sep 2019 13:50:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 25 Sep 2019 13:50:38 +0000 (UTC) for IP:'209.85.222.196' DOMAIN:'mail-qk1-f196.google.com' HELO:'mail-qk1-f196.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.196 mail-qk1-f196.google.com 209.85.222.196 mail-qk1-f196.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 08/11] driver.c: change URI validation to handle QEMU and vbox case 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Wed, 25 Sep 2019 13:50:53 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The existing QEMU and vbox URI path validation consider that a privileged user can use both a "/system" and a "/session" URI. This differs from all the other drivers that forbids the root user to use "/session" URI. Let's update virConnectValidateURIPath() to handle these cases as exceptions, using the already existent 'entityName' value to handle "QEMU" and "vbox" differently. This allows us to use the validateURI function in these cases without changing the existing behavior of other drivers. Suggested-by: Cole Robinson Signed-off-by: Daniel Henrique Barboza --- src/driver.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/driver.c b/src/driver.c index e627b0c1d7..8f9da35f78 100644 --- a/src/driver.c +++ b/src/driver.c @@ -276,16 +276,30 @@ virConnectValidateURIPath(const char *uriPath, bool privileged) { if (privileged) { - if (STRNEQ(uriPath, "/system")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected %s URI path '%s', try %s:///syste= m"), - entityName, uriPath, entityName); - return false; + /* TODO: QEMU and vbox drivers allow '/session' + * connections as root. This is not ideal, but changing + * these drivers to refuse privileged '/session' + * connections, like everyone else is already doing, can + * break existing applications. Until we decide what to do, + * for now we can handle them as exception in this validate + * function. + */ + bool compatSessionRoot =3D (STREQ(entityName, "QEMU") || + STREQ(entityName, "vbox")); + + if ((compatSessionRoot && STRNEQ(uriPath, "/session")) || + STRNEQ(uriPath, "/system")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected %s URI path '%s', try " + "%s:///system"), + entityName, uriPath, entityName); + return false; } } else { if (STRNEQ(uriPath, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected %s URI path '%s', try %s:///sessi= on"), + _("unexpected %s URI path '%s', try " + "%s:///session"), entityName, uriPath, entityName); return false; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 00:42:33 2024 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=1569419447; cv=none; d=zoho.com; s=zohoarc; b=UKM/K7tWcIJjkFvZ39sPCM4S7/4bxtQQ49/BJOqJGY5fKAipU1bwDPeEDDoqPs6KejYb9z/HVMdsCH83FW5yKZgXnnTuKGVKg0ijGKZyjX3AcFtDfRwSbhYR1zEXh939NZgE1wxOC467FfbKLm3SlW1eh0GADIBEKUmWRsMZYu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419447; 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=RLrmRdpstVz/QwY3jXNeUM0Bn16japy8ND4M3sF2Tmg=; b=EdxuCZo8cR4EVS4z9IBjxKSWMUvNRV3sF+2GgoVZNx8F94xLTdbv1KLbjKAhH/aRH2ZnxHHrhpa+mrWRyiF2e4jpsR2B4Kdj68KXcnvIi6moedJxDyFXolFzS7KFUmTBs08EQg0fIMxyZXKOHlg9pRkviQNj5h5sS/vaYwIcmEU= 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 1569419447675624.498572190976; Wed, 25 Sep 2019 06:50:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E62883172D87; Wed, 25 Sep 2019 13:50:45 +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 43CD762675; Wed, 25 Sep 2019 13:50:45 +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 E00BC180BA98; Wed, 25 Sep 2019 13:50:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8PDoe4W014140 for ; Wed, 25 Sep 2019 09:50:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id EE16910027B8; Wed, 25 Sep 2019 13:50:40 +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 DF72110027A6; Wed, 25 Sep 2019 13:50:40 +0000 (UTC) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (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 C07A1C065128; Wed, 25 Sep 2019 13:50:39 +0000 (UTC) Received: by mail-qt1-f173.google.com with SMTP id r5so6633452qtd.0; Wed, 25 Sep 2019 06:50:39 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:38 -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=h1wz5UDvGcrtp1pjXnEgSnuZUOj27Fgz1zf0oDB8Ph0=; b=N71o96xrOsVgF2ITVgSVGnPd5XeQpIrdJQBOrMrmy+TdxsT5BR4lDKNe7GaDA0P4Mt BfNuIVhO7+gyPO+/KuTN6XRAPkFNJWj4+VVGJlpwhvEjfRp5dQ5LwB70ZBU+fIvE2Jfl gEEu/2IUk3pg7+PyQbnd6nO/qzPvKs8loTyWQq7845MNhrwUlacGTFexZU75ZzpN6Bwn BcRS8Dlwo8WV5bZUmOuzhyPaupI4GOIXonEne4x5hsJu4rVhgHkddPafjS85mbQ7nsW5 SNata/NMNLgiHA77KqtIXrp5C64DDp+Xif3I4IJQlCvEYJgT50A0faW6tiI/t7CJbSbC V7tQ== 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=h1wz5UDvGcrtp1pjXnEgSnuZUOj27Fgz1zf0oDB8Ph0=; b=AFF0nBxskfTQXV+2Uc62gTkFhfNemsck5uSReTuxqDMnVMCenOZxUPP5aEFaPurSmN X/nwnnc3rObyOd5YkW0bU+B099vtNrfU4wmQsdIPy/U2X2z2J6l19f4F68EdLO8DWFIL 0FmP0VFexyl/5++9wdGJ7o+2kFr3Ue4jVkUKKyJeb3HIRF0oea3cmDn9lUZN2qNLHc0K QlbIuEcKTtQjs6nG/LOCy4sn6zC30K3rjT3SVvYDSvysI000An6Js1bUlivKgFn/IUo0 2ShTwLDsDfkcMvG3MBAOlv4Qwmtd1uLVvNepwmkW0kYmrrtwujIbDnNtQuGznCIKAJ9G 3wlQ== X-Gm-Message-State: APjAAAWl9Q6JDpAVgMWXv7C5V1bXmlaWsDjiJtr/hYlW92sqGsqX8Jzu xXg41ZfYGOwu4/VTLdYZC/WXeTFZ X-Google-Smtp-Source: APXvYqzW9oLUSgwww0wt85+ADwZsGGIEO7pkLH7DXB7ODZCHlc7yCgKXRU2g3ngRPrIS3nZPeiWgGg== X-Received: by 2002:ac8:4304:: with SMTP id z4mr8677452qtm.160.1569419438976; Wed, 25 Sep 2019 06:50:38 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:09 -0300 Message-Id: <20190925135011.5689-10-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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]); Wed, 25 Sep 2019 13:50:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 25 Sep 2019 13:50:39 +0000 (UTC) for IP:'209.85.160.173' DOMAIN:'mail-qt1-f173.google.com' HELO:'mail-qt1-f173.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.173 mail-qt1-f173.google.com 209.85.160.173 mail-qt1-f173.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 25 Sep 2019 13:50:46 +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 db4b39dc9e..abd1533889 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 From nobody Mon Apr 29 00:42:33 2024 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=1569419456; cv=none; d=zoho.com; s=zohoarc; b=muoZLJ7SQYkVrKcC1euPpxsCwzvTCBo8Rf+uS44TQHvfwemoIMZh0CMNwoBinzaGNEsRZGZ7yuTAt0tmu4BapcYLRKsYMFjDHBy03ON9fmbAxGpB1NWHQWhCOoFVgcDuse/UfQWyIyEuucQbFSg3ZdgMRjHGpNrat9klTnZwilU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419456; 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=I2GPp/WorDc8gSC7zWkrvS4LWAabDZ2gADWSpyq6vjc=; b=jQKS0YlsZCqAFE6kENDb/J+ZKajyvGmp3ob7FPzyaG0urr8SZOrD8qcmlQ7/FnrzoL2yaC1JC3l0d1bpnp/wCQfHmHPbWjcEmtUFwVq4EW5na1MliJRRIWqRetdk5Rd6DXecjs+cuTtk0uPlwHys8RUubYSG8eqMg+XRLuyjf4c= 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 1569419456993498.17923643795905; Wed, 25 Sep 2019 06:50:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 515DA3083392; Wed, 25 Sep 2019 13:50: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 2146E5D721; Wed, 25 Sep 2019 13:50:55 +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 D119B180B76F; Wed, 25 Sep 2019 13:50:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8PDofR0014147 for ; Wed, 25 Sep 2019 09:50:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id D80D261F3E; Wed, 25 Sep 2019 13:50:41 +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 CD6B361F2D; Wed, 25 Sep 2019 13:50:41 +0000 (UTC) Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (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 20DE2308C21D; Wed, 25 Sep 2019 13:50:41 +0000 (UTC) Received: by mail-qt1-f170.google.com with SMTP id n7so6622215qtb.6; Wed, 25 Sep 2019 06:50:41 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:40 -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=BU0iQGc1S0P5Uat9Mv5QunKxue/pjQrAzhTy4NehCw4=; b=SIV2ovx04hutjH2mfVmHUPpeiHeZZ4WCFx1LmCNb22Du1Surr+lom10dvHX9L3K4bG mIIkMnTIA048ySuewvqRmtGDVxx2puf4N6qOYooUg2DeEmJydrDpykmh5yrjIjtsL/rt NXB2zkSj/ejQAJxMKmu7K7RSM0AEm2Pg9Yg2h/vEaj5w/pCTCXlcuEexF10qzly34vSM NSKEhQrxJflzGSRyvknqFKqFCglXcxJv+BKXEhHHw4qFCEmMxf3Y9SP67LK4KKefzj7l Kgwju3S+EsJDlaO3WMgSBeyLOjBmPYFb0/7DIk88k8IU8CwAabtuSZnPw9zi2ST9tQnP rFfw== 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=BU0iQGc1S0P5Uat9Mv5QunKxue/pjQrAzhTy4NehCw4=; b=ggSw2sT3mec/jeHl8f3niH5ItwQMI41EN06JEpsQPiJX7ig3bvOkANI1xDnOeNf7d6 Qh7F7XDUhwI+q1Y5Fk02ECUL4ghr+47o0RINKxw5scivzdx5keGPW+PIXNptVnpbvuvz AxxxXi7fnWFQ/AH4bnq/q4wFctobUKK9hpynpmwGmaYwQ+kXB43xQ2OL7mGAqf9s5Ac0 iAaK2KdDPZv6IcmtSXfJ/nW2X4E8z3rBpDA7Oqn69sKUJOmKOjIYqgL8QJUQxaJE9MTE 32u+38wiGUUc3Wsiqk6u0p7wUIX6N/c0RcYv+Uy5ZQ3RVWH0UyL/gDo18nxRL6zX06j0 W+0w== X-Gm-Message-State: APjAAAX2c3xpZuIH+FESNroL8HkGtZpw7ruL5Y0/H8aaYb4SDavL3RPd zAjs++owvXJZXOObWh2fFmZalSVw X-Google-Smtp-Source: APXvYqxGbs9/q4XKf7Crk8wkcB5kv9SCFBvyRkUGy7N0+z5xIyVZC0dPUe9RWRPwAtln8yWy2kcRpw== X-Received: by 2002:ac8:5512:: with SMTP id j18mr8458195qtq.89.1569419440372; Wed, 25 Sep 2019 06:50:40 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:10 -0300 Message-Id: <20190925135011.5689-11-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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]); Wed, 25 Sep 2019 13:50:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 25 Sep 2019 13:50:41 +0000 (UTC) for IP:'209.85.160.170' DOMAIN:'mail-qt1-f170.google.com' HELO:'mail-qt1-f170.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.170 mail-qt1-f170.google.com 209.85.160.170 mail-qt1-f170.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 10/11] vbox_common.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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 25 Sep 2019 13:50: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/vbox/vbox_common.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index ddabcb80ca..d3b8fb625f 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -517,20 +517,8 @@ vboxConnectOpen(virConnectPtr conn, =20 virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); =20 - if (uid !=3D 0) { - if (STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown driver path '%s' specified (try vbox= :///session)"), conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } else { /* root */ - if (STRNEQ(conn->uri->path, "/system") && - STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown driver path '%s' specified (try vbox= :///system)"), conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } + if (!virConnectValidateURIPath(conn->uri->path, "vbox", uid =3D=3D 0)) + return VIR_DRV_OPEN_ERROR; =20 if (!(driver =3D vboxGetDriverConnection())) 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 From nobody Mon Apr 29 00:42:33 2024 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=1569419451; cv=none; d=zoho.com; s=zohoarc; b=V3N3J3Z1WU0P+Nu+KkBcYTtI76HzIFjDXMOdG5riG9Pdmi7LhFduW+Ag+YVWlEMcyy1TBfr/UbXt7G9gwuncOIacqA0uUWHvnpUZJXiUwrK5hayEmjUAwXWiOWaojnxKHJ5atdTmO5O9Jw5a3EwfNlsdra4hRlTH9AoANik14Vc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569419451; 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=OW3KV8cU4HbiixYN5tUSg93K0rmfC+6qjb5IK6g/il8=; b=L2x3e8AVR6bsL41JSZ0+qDjzOmX3rVOQurG12TphtZnMtDvSZ50859Rqy29LK0qcSKKe2axIOfIDPYgCVZ9tS/xXenU4JbQZPCxQsjQ+6416WkpkTQd+yb0UPZtCQAZx5Sg6qRYhbCNocqiFDAKL5IoOzOXOdHhi8CbNj2fHKZk= 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 1569419451145667.2383530285889; Wed, 25 Sep 2019 06:50:51 -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 554A47F758; Wed, 25 Sep 2019 13:50:49 +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 26649605AD; Wed, 25 Sep 2019 13:50:49 +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 DE22A4EE6A; Wed, 25 Sep 2019 13:50:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8PDoiUd014171 for ; Wed, 25 Sep 2019 09:50:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5EB4961F41; Wed, 25 Sep 2019 13:50:44 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5287961F40; Wed, 25 Sep 2019 13:50:44 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (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 19B13C057F31; Wed, 25 Sep 2019 13:50:43 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id r5so6633724qtd.0; Wed, 25 Sep 2019 06:50:43 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id q207sm3185111qke.98.2019.09.25.06.50.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 06:50:42 -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=Fj9gBFFeucN0qcWh2dtToWli+nOYlydZH3LPZzljERI=; b=KxeM0xiMOYNDjQT7dX7SCkDqngLKdp8NOVNJAPg2GlOOs1uTkCZE2SelGL/oAWUykX vgmltdTkN7vOMdq9hCvyg/HiNHL3yYN+K/wz0YJiIlJ/bC00y1LxYOxnTzuDYWLK5UbS VXe3ATDM2v6Cxi1xbCGUXDzTnbJIWAETre0MKFrQxHqHdOjhkB6TVxHOMiaWJMzPqGQf 62Xpw3qF/CBrLszsk+0VLq0QfoITn86nwGdSe7QzyB0/WI2Nn6J62kjgPWuyxly1cc9H bYqapjR+bBKTZf6PvwahmEeyrfg4PDeyWNrUY3JyiU1grySmOGIA9bD/AYzIC6bATIPF /0RQ== 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=Fj9gBFFeucN0qcWh2dtToWli+nOYlydZH3LPZzljERI=; b=HOIV/I+bSdxCIY7UjOtVCRQX96Tr//dF2dfZVeaw+OFaMuc3zOo49IqIrtKZy8d9qF KbyrrEuxQoYwCWS9SPVXMZSv1I7Bt8yE3WnUvbMNsZoc1WlangICmwc61NQ38i1TcZ1S zCbEE6a1o5jjDFAvmF0ue0eWBoGrTw0WkOA9JnwtN5TEhcRBKJ5S7sMRgcWlKph401PB Mw2TKEvos88dlpDLbZ86e+LjdjrMnjfwLk0nmOlS3EUSaeQgYkF8Gjp3kGXytSzjhbjT 9EfUCSC3ovBsKA/nt+TehA9PtzJeIcj9vHVvVBpcOYW7jsUDG6p/GcuK2QFHyjPqyyom cMAA== X-Gm-Message-State: APjAAAU0L7Wo3leKBs/HKEDT0k188yioCeNYJJT3ljS32Rkp2znItRVl tqhz/AANc93Yi7zKTG6Wa/mGgFs4 X-Google-Smtp-Source: APXvYqyvbASF05wwx9RsbJub42BhxbdweQishfz6B4efF/rlBupG9ll0UZVb1vV1P/NqTlheA9cbBg== X-Received: by 2002:ac8:3525:: with SMTP id y34mr9040547qtb.140.1569419442335; Wed, 25 Sep 2019 06:50:42 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 25 Sep 2019 10:50:11 -0300 Message-Id: <20190925135011.5689-12-danielhb413@gmail.com> In-Reply-To: <20190925135011.5689-1-danielhb413@gmail.com> References: <20190925135011.5689-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.32]); Wed, 25 Sep 2019 13:50:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 25 Sep 2019 13:50:43 +0000 (UTC) for IP:'209.85.160.194' DOMAIN:'mail-qt1-f194.google.com' HELO:'mail-qt1-f194.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.194 mail-qt1-f194.google.com 209.85.160.194 mail-qt1-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v3 11/11] vbox_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.6.2 (mx1.redhat.com [10.5.110.71]); Wed, 25 Sep 2019 13:50:49 +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/vbox/vbox_driver.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c index 1f31fa28df..d7e80828ab 100644 --- a/src/vbox/vbox_driver.c +++ b/src/vbox/vbox_driver.c @@ -58,20 +58,8 @@ static virDrvOpenStatus dummyConnectOpen(virConnectPtr c= onn, =20 virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); =20 - if (uid !=3D 0) { - if (STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown driver path '%s' specified (try vbox= :///session)"), conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } else { /* root */ - if (STRNEQ(conn->uri->path, "/system") && - STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown driver path '%s' specified (try vbox= :///system)"), conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } + if (!virConnectValidateURIPath(conn->uri->path, "vbox", uid =3D=3D 0)) + return VIR_DRV_OPEN_ERROR; =20 virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unable to initialize VirtualBox driver API")); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list