From nobody Thu May 2 05:56:57 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=1569271485; cv=none; d=zoho.com; s=zohoarc; b=DB6WVYZ5FlTRWq/kp/HRpCdU37XVuT3Yl1DPiz4naBJnBmi09vkufvSjr8vtJZiiDw/c07ttA8CdB3BJSdaNSfkBBK0Lnj12qgm/oA3bmz787wILAruA01l/iDsclsC7AO8VfRXHeKgQ8Bcol3UJq3gRATOGYgAxANGrq42pvRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271485; 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=AXY7melZbDA+V9/uQZFeH6qLdPRQLRgBDv4seICP0bpraUzQJFAzMvMyiKDvSc+yCtriFMVOPitsV8ZipyDo+mpimKildrQCioG7G+SxemDf5v83JoL3xaDrF1jNxwc3gRy7gOzDy2WGfUs0EbK1jEVOhPIA68CZG9J0Kb3czaU= 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 1569271485215211.19057733136322; Mon, 23 Sep 2019 13:44:45 -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 B06DC81F31; Mon, 23 Sep 2019 20:44:43 +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 D08ED6017E; Mon, 23 Sep 2019 20:44:42 +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 C78531803518; Mon, 23 Sep 2019 20:44:39 +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 x8NKibH6031606 for ; Mon, 23 Sep 2019 16:44:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6E3B560166; Mon, 23 Sep 2019 20:44:37 +0000 (UTC) Received: from mx1.redhat.com (ext-mx23.extmail.prod.ext.phx2.redhat.com [10.5.110.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 60AAD6012D; Mon, 23 Sep 2019 20:44:37 +0000 (UTC) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (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 A195F1096908; Mon, 23 Sep 2019 20:44:36 +0000 (UTC) Received: by mail-qt1-f169.google.com with SMTP id c21so18800568qtj.12; Mon, 23 Sep 2019 13:44:36 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44:35 -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=niKLYRpeG9yaT6BB1GQXzpuHaFiaXJ/Xqfs374jBI5ea6DhUaBdt7o6QnyErrsCNBC OpTNtqgO1RpsYZvloE07LL/zreeVivJbQgU4gQGhP/MIy4yWRwnlR5rfu0GvlsycrKSO 0D1KPSFFf9KvbRYW4gm//HiJ+81qOH1EdTO3ECq+spk109u3slgAGPu4gv1Ky0RVvjtx siAXRBMHgmDJ/CxfrwbnG8GL19xo06lPyrr3t6ns7ewKuQcIaEfilmR6rqvSZKTtNuGe 46G0zM+vlabB8jE4XHrDkUa4LZRCibiBrbbs4n173pUO8uAkMWa74Vy/Nq3ylU5dNK3V tffA== 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=qAV/7dI9xlFjyBYGUoYbN+65ZLUD6yQoIEe4AvFGA+lNdUPhW1aSI5AjYCWfAr30E+ QLFO22efwT5t9YyWwJvl8vYKM8HrTZGJfxN54SGPLMfgLBkM02hjHWR69KcBUMCf5U9G xiUaBtYcgNwcMCkpZEl1Dk7PPGneAXO2CtN3OXcRSORCF6d7IOV0FTRs4pGVjgHlNRAh 20KTmGWam/d2h3KOr3yfQAlndpSCBqj0U32mcR0y2MYyX9vACyx44qOj+o1ksw4ZdsjJ VrUwOFTQb46Jj7fAheS+dxCn3Xig2I2gcIpE2Dxo0agueGaPtwHGI4ERPRNU//keG0rf 0LOA== X-Gm-Message-State: APjAAAUJcuEQTcvAmyZZ7VrXSV6Pngfx6QG1L0KthaJSHgj0vGiGrGQM SZeIr61NOq0WTqHvcZAY+W2Z/YzI X-Google-Smtp-Source: APXvYqxzxYX/F71eAYQoxxWWTBh0fzyTY4BNQmwJbe+gJUW9r6ERiYTEcKhaiV4Ahzn/rBli4UXxhA== X-Received: by 2002:ac8:5216:: with SMTP id r22mr2066875qtn.281.1569271475885; Mon, 23 Sep 2019 13:44:35 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:13 -0300 Message-Id: <20190923204423.23824-2-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.64]); Mon, 23 Sep 2019 20:44:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Mon, 23 Sep 2019 20:44:36 +0000 (UTC) for IP:'209.85.160.169' DOMAIN:'mail-qt1-f169.google.com' HELO:'mail-qt1-f169.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.131 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS) 209.85.160.169 mail-qt1-f169.google.com 209.85.160.169 mail-qt1-f169.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.64 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 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.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 23 Sep 2019 20:44:44 +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 Thu May 2 05:56:57 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=1569271500; cv=none; d=zoho.com; s=zohoarc; b=Z1VzF54EWc693gCQfooPV5m/RdAbvM4idkZu8qLZ9nl9GBHLVsMbes2bis80HOGSHwvWGx8M7MnsUNbR0MlLzXyO0m7IVxyPtbY68F4QWDT9sku9tI7QUSY2qKkoKN7ghFCuHqJoQLeijnGDkio50/7YDFiwCuT6qhnSuwER43k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271500; 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=6pfZyo9epk/TYD13zwF8kB1GXxHpz0YIyzwnHaf+6lQ=; b=BDcIvfQPoSmyEXrnvdbrEw9IZOQkaGgE2RKHgmc5xHVon3pVs+K63j76UVeJ31HZbupjWAk+z4Ox0TurF1iID+wTMAWCO/1hYmF+sA3TfwimaJqhK5PNNflb2ygszAWIHzwHMWgnK5SR3nXBjuXqEe8vlZ/S9Bxo0GmXpXGY2Ao= 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 1569271500280635.8049369216212; Mon, 23 Sep 2019 13:45:00 -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 B9CA6C0718BD; Mon, 23 Sep 2019 20:44:58 +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 8A25B60471; Mon, 23 Sep 2019 20:44:58 +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 4C9684E58B; Mon, 23 Sep 2019 20:44:58 +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 x8NKielY031621 for ; Mon, 23 Sep 2019 16:44:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id CD20460BC1; Mon, 23 Sep 2019 20:44:39 +0000 (UTC) Received: from mx1.redhat.com (ext-mx30.extmail.prod.ext.phx2.redhat.com [10.5.110.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CAA84276; Mon, 23 Sep 2019 20:44:39 +0000 (UTC) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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 4B8627F745; Mon, 23 Sep 2019 20:44:38 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id u22so18803248qtq.13; Mon, 23 Sep 2019 13:44:38 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44:37 -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=UrwdspBLqztNDkQg90/pAV9VyHGMDXBUFxswlPI8FfY=; b=bwyoPC0SNmaiaC+5UVE1ppxHHsVQEt+h30on1Fi56zdKh59SBiBbJ1neRVVtq0lZxV GYHeFe/WK3U2WwRN7dbYQu6fWv12xsXLw14mh5+oLp3qRekVNETB2lt/EIkjCK2F+Nx1 MrgqqEAZtBgXUQyDU9lj1q/oujxXkKWkP4PJiP90OB0CbQJnt7k+0+18JvXZMoZLPgrv Hf3C9LTloqTzzCPlUkpeqk41ExCd1J+mh6YZrVzvJpZMXzG8aXzydYRP5W1v0q+LDxIT QCq9r1fsLCTN12MUj5RdpeP383Gg+gjP7jJeoV82LjYzmdLEiS/x7StFcVnstmQH87it V5HQ== 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=UrwdspBLqztNDkQg90/pAV9VyHGMDXBUFxswlPI8FfY=; b=hdOXrdPetAbVXcq5SAGqgq4ivOVn0bSOgo3FVEfYng/Sf2HE/WSX0sZ/24rhL2GWeL MFM5eGPqhB+Ir7EmOOOAZFO/O/fHBGOTCYKPmJyobQKxJwi4TtvlW06I/8nMm9EDOFTZ zRSBpF2bso6MSNO14XKZ4hABdpetxCbJyN5oT23NugZcpnKzKv63x9PQNs40lX29Y2Bv 2hs059e7ZHvYM1dq1fOp1+FR1duhe5wyqSSQCvaCuGhN6fqQlmriTAsXuRC8zijPh6JB adQmgP8sDA8s+6K7TOKnE4s5fvIssAw1+rfpFH2WKRifOR/SMNspHSmo143k7rMnqoU3 zL2Q== X-Gm-Message-State: APjAAAWl8MtyG8q2q5ECtKYZM78J16y9OjVO/9ueQLEwEO+DkpCMnoEO 1KsRQqqiJ8WW5WaZTQIHCTG3Jpvd X-Google-Smtp-Source: APXvYqzVxbAAaWvYiwT/VBMG00W1bGzELIHhTeln8H8vfIclEBkvQeonwAT5Z82wF9sOzlx3r17ndQ== X-Received: by 2002:a0c:f091:: with SMTP id g17mr1075549qvk.181.1569271477409; Mon, 23 Sep 2019 13:44:37 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:14 -0300 Message-Id: <20190923204423.23824-3-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.71]); Mon, 23 Sep 2019 20:44:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 23 Sep 2019 20:44:38 +0000 (UTC) for IP:'209.85.160.181' DOMAIN:'mail-qt1-f181.google.com' HELO:'mail-qt1-f181.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.131 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS) 209.85.160.181 mail-qt1-f181.google.com 209.85.160.181 mail-qt1-f181.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.71 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 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.31]); Mon, 23 Sep 2019 20:44:59 +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 | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interf= ace_backend_netcf.c index 9659e9fcf1..7fe8f230b6 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -200,21 +200,8 @@ 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->p= rivileged)) + 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 Thu May 2 05:56:57 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=1569271500; cv=none; d=zoho.com; s=zohoarc; b=UhN6Fj2cUXb9ucqdwdBJukyQlYeX/G8cvO8gFcZvtItwSeS//hJSif3p4v54lH7NAdOMWFiN/jC9JIfOdyhjcIXaeJzC6OZ5gESK8yqSTG2a0Q3e+tUgZfQKPSKB1wSRvIV1KL1VZWMies02d4j7QEw4ytVbYvyxcBfMDhsYW98= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271500; 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=AgFyjIzX84LtERYKKqnmrXrJSWOIjl5Hx4FyKbGE8SU=; b=DbZwUFe/GD7qnhq+WuBbWcZLxmN4VQTu9a0S8fcQlZrY106VptdwB7rzdbCruPT7u/WUhqY4kyVRvtPSwlG7folFELhTrj6rW2eE1o7KBhABK4CmrNCKderc6J9hfl+r+JPdWpuv9n/Z5lpKDdoAbIpW+nMr8ajw4kri9l5EehA= 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 1569271500712582.2127883634233; Mon, 23 Sep 2019 13:45:00 -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 CF304C0718BE; Mon, 23 Sep 2019 20:44:58 +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 A19DD6012D; Mon, 23 Sep 2019 20:44:58 +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 6602A180B761; Mon, 23 Sep 2019 20:44:58 +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 x8NKifQm031631 for ; Mon, 23 Sep 2019 16:44:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id E484C60BAB; Mon, 23 Sep 2019 20:44:40 +0000 (UTC) Received: from mx1.redhat.com (ext-mx23.extmail.prod.ext.phx2.redhat.com [10.5.110.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9507760BBE; Mon, 23 Sep 2019 20:44:40 +0000 (UTC) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D872F1096901; Mon, 23 Sep 2019 20:44:39 +0000 (UTC) Received: by mail-qt1-f179.google.com with SMTP id d2so18880970qtr.4; Mon, 23 Sep 2019 13:44:39 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44: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=AQT+//WxQh+BQMzjPi3JunIac4UDw7Zum2hVVNZLw0Q=; b=rj2GZ6oyUJsSHo34uqDP5yQ5exhlj11QTy8MCJQLouvmGRQoCeJIPsgUcRR9Zb9DwQ pAz2OPJlKw2Bbcke9WitQYiO2VNbAMeXQN5yMuGVVw6V/CrLGnNWn9NEkoHlG6AcnQ1Q wO1YQdA7ohqvWzgDc2OdBITcrrtDaKiyDBUqyAGoh+APoufq+scrAl3AuN9AOUixM4w6 ym2y5ICjRGdR+pKUzNNqm502xW5mpxeRGt+8KR2AH49Ti4M4WGytCKGvb9szgdh3V9n7 W4pkMIwS020NxxBCPHoDOoFJGcGo4R0SxvEsSz8TZ2QIQz10p7VYU57uCcM1DDi0l7Im 61qQ== 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=AQT+//WxQh+BQMzjPi3JunIac4UDw7Zum2hVVNZLw0Q=; b=uObP0o64Le9MMib/n5c6Lrz0OVB47SyG+A+qjSr+3RMxqUqEeUxD1Uz9togEMCEmiL Kqe0CRN532lkcRYKCHbVmUNxl36suge6jeh4fKfONWF0E4WzSm1wBtHSJPtFNzNcUs4e R9sT8S+LeqMmFnuyeGu/bIqH38KpQkvsvyt3+aydh54/aOe5AV0WqP9wLj58NylEvsIM TXoBjM49GTb2WmJmSvjl27bo3eVvm9QRxiaqTG0XkdxTw40MereA51NwFnAFrBc3FKn1 0JfRy2v421NBL+cx9zgoMGBy+NJEMHD0f69iAeI9kAieqVXfqvgWfGvZZUb/0xnD6wac gwQw== X-Gm-Message-State: APjAAAUJpqX5+UhQIXcEG0Ig3umd7jv/+Z+vG2btPHPqaYguFt4yKu6C REYS3w64rvUQDmesg38k6AvlG3Tj X-Google-Smtp-Source: APXvYqzSPyA3G/y9m7MGlQevl5uByk5E8vcRwUi3XQBnCxxQF2jdIV9S70bMDmDjT6M/sSF8kJ/1Fg== X-Received: by 2002:ac8:3482:: with SMTP id w2mr1997120qtb.379.1569271479063; Mon, 23 Sep 2019 13:44:39 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:15 -0300 Message-Id: <20190923204423.23824-4-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.64]); Mon, 23 Sep 2019 20:44:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Mon, 23 Sep 2019 20:44:40 +0000 (UTC) for IP:'209.85.160.179' DOMAIN:'mail-qt1-f179.google.com' HELO:'mail-qt1-f179.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.131 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS) 209.85.160.179 mail-qt1-f179.google.com 209.85.160.179 mail-qt1-f179.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.64 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 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 23 Sep 2019 20:44:59 +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 | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/interface/interface_backend_udev.c b/src/interface/interfa= ce_backend_udev.c index ddc3de5347..d870e3d1b1 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -1250,21 +1250,8 @@ 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->p= rivileged)) + 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 Thu May 2 05:56:57 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=1569271504; cv=none; d=zoho.com; s=zohoarc; b=j2kV26ilRX7KJ0uiQYGF47/+e/uFt0beuVLsqQ80rc65gNI7lgCf4D8O2PoOwT8BYK0CyP7GJ3SLu6ElWptSWlaT60o8H9QRQByDQhtLn8d49xPaHpN/9veB4er06AfdRVww1b6t+txngjOjMcPjfhC58b4iPqmlKgYg+fbbEQA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271504; 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=GdFs41oVWMJ1kYuDNC8xKMD0YkwWkmjVvVCcvzZP7OYHYXfmDpFbMasGOFrLra7Of9QL6NKfqBpr8K4eiT2lYVSQKbsFTrNO5qTMFh9R+tL+mGI24azzAzixNA+z3yx6V3TpbKo9VJZLtK5ODiVdhGFO5GrewtuQ+bJoCnU/BIo= 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 1569271504536439.33762997560973; Mon, 23 Sep 2019 13:45:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB65D7FDE9; Mon, 23 Sep 2019 20:45:02 +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 6AB72196AE; Mon, 23 Sep 2019 20:45:02 +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 BE6D14E9F2; Mon, 23 Sep 2019 20:45:01 +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 x8NKigUV031639 for ; Mon, 23 Sep 2019 16:44:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 675236046B; Mon, 23 Sep 2019 20:44:42 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A7EB601A2; Mon, 23 Sep 2019 20:44:42 +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 BF45C308FB9D; Mon, 23 Sep 2019 20:44:41 +0000 (UTC) Received: by mail-qt1-f180.google.com with SMTP id n7so18864370qtb.6; Mon, 23 Sep 2019 13:44:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44: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=MdwUhcEZaamVOHXrzW/zyFZIP1ktgOilvenvwCcgh88=; b=bupsViWJWawviHDfe57z+0sLxICYu1Zy8tiYCQPz3Sd1JjWtwQvhH0TkIcp9tTjGPV /ENky/I3qeQufY20cL5vhyRn/lZYI3ZrQISktAPMXfxEFhL/1kIQZQotOWJhtuohx6IM WnUpLnzDS4VrAwJge/elP4boVSr8XiGVff8PTc6lleNtqXdrPmzwDibfoEttIcozkQSj cvA0nGMYIrDmefmUd3lYUTKgCLeoVbjpIeuan/pyYlrPuVucI1Fg6w/7r+ovc1chu5ck IAKZx3q6s/cIfcepSqvBN7M6k5DnBOBWLliCz0R+IYv/BYTtETPDDB1bLWe+T78Nl+E/ PSfw== 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=giuCZSk9TACK2sMi0v13VeqxcSxF+HrrztTQbUolAVwI1gCKFqKLYyygcsnq/cqxwb li85e5WScw3RybDwGUNntofSEXNtUn1I9k24eRz0UCS0b2AsuE/CQH+RABzzEgQokByB JMhK4CaxZEtdyuz2k+NofTaF8ZTJsfQ0XPF9scApTZCWkpBZB7EXF0p9FPvvpVVQxbIh 0f7ng43LltstJBs/tqPVr9oObYKHaSUIo2SPKQfUBLBLqCCnSi/N/Q/MGcnc0zHv6MFF yX1CssQtV7n4vbpP6Yzg048i5hLYzns6UvAFFXV2FSN7yKf7qn83QSXcsiNIBh3qFlRR KZ5A== X-Gm-Message-State: APjAAAWl9ui+0rgIgj1U7Hu3+VsHFGQFloj9PE2nZdMKzOxD3tstaYoY gGDHAKXBkahr1xqJnNjVrn3DvUqT X-Google-Smtp-Source: APXvYqzjq5v48sDDQfGAtsEd5YDi/Iw0/Kt2s5uBl33q0UgbsxgErsZeoeiXY6DheLiMvSYlJgbqOw== X-Received: by 2002:ac8:710b:: with SMTP id z11mr2116899qto.372.1569271480974; Mon, 23 Sep 2019 13:44:40 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:16 -0300 Message-Id: <20190923204423.23824-5-danielhb413@gmail.com> In-Reply-To: <20190923204423.23824-1-danielhb413@gmail.com> References: <20190923204423.23824-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 23 Sep 2019 20:44:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 23 Sep 2019 20:44:41 +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.131 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS) 209.85.160.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.43 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 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 23 Sep 2019 20:45:03 +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 Thu May 2 05:56:57 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=1569271504; cv=none; d=zoho.com; s=zohoarc; b=OreXEkApOo3idMolusupeijWIbOk8gLz9WITRmG2bUqFYxwZWVIFxhCDjY0F/9mP4qYrCA0joQI8hyeAx+QnALzPIsdVa9k9xySjvxDRR+9wxb6ivAw82pdbt6CmvViR9oAPcmZ1mnCjP5fTXm6BhfXMZM7IgBZ25GMLayCOVWQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271504; 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=3NTsbYQxk4el03Rp4fvmpqmwvFgeQC9ZcwJExMCFtxM=; b=AqJ60Q2EWFZ+74DkFCGnhKYTk0i423v4i77Jlpm3/7wfWP/VoZrMDmQK8w1chNqFdUi6dipXjDtPbV/wCNUBStreZNb8F5v7pXa1dKltTamgKe5zxyy2ei3X3BtDxWZV6iD3G723agcymvinvGK/iicP3k5+kMApjeVZOXngw9M= 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 1569271504781585.9927891452066; Mon, 23 Sep 2019 13:45:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C480530A5A54; Mon, 23 Sep 2019 20:45:02 +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 784095C66F; Mon, 23 Sep 2019 20:45:02 +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 ECD26180BA96; Mon, 23 Sep 2019 20:45:01 +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 x8NKiiuQ031661 for ; Mon, 23 Sep 2019 16:44:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 23F6C60461; Mon, 23 Sep 2019 20:44:44 +0000 (UTC) Received: from mx1.redhat.com (ext-mx30.extmail.prod.ext.phx2.redhat.com [10.5.110.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 177BF60579; Mon, 23 Sep 2019 20:44:44 +0000 (UTC) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74EFC2102; Mon, 23 Sep 2019 20:44:43 +0000 (UTC) Received: by mail-qk1-f171.google.com with SMTP id 201so16891850qkd.13; Mon, 23 Sep 2019 13:44:43 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44: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=9hZhSSJwCMNgdMo5WSNtMnuIDICXNQFFCEv0AFbcSHc=; b=IemssCcEXHnIhiy9N6/VkBBY+iHo0Jvm8Jgqt9nXT6/Lv0OiPH6fA82qIbICyQ/DRl epIt7sufjuu/5WeCvc7CUDURuiZql+eYauCAm21/pQNaI4wtiNeeYigvEYbqaiabk3pO T77Bk4lFPmGgI41XWdxqKQUwujR/1GymKeqq1lvVk9/Db4V9l44+h9O7j7lHDZR2gvb6 YityTbQfKhsFnIwaljQpB5V5aS/ucceZG17v/sxY2/8ESb4I3pPRfspUPDLV7+Fvp/xJ 1k7sGIYj1Izb6MR80ud38/Adjd0Y2AzV0J2HGuqdgzGZKvJdaqOQVggp5HNkUvCwaRx3 TXhg== 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=9hZhSSJwCMNgdMo5WSNtMnuIDICXNQFFCEv0AFbcSHc=; b=E0ZjzUHK3ulCrTLdRSehYVPbjWI8xK3zeObhBe2yiEbz66bW7YxGlU9bl+IKp+YSfH eYTwDbg5KJsIaxoc0jS0Wb/Be92W/DlkCQZf2IsV6qI7+yBV4REJHB9KUfu0LXxDMsAO zuxW2t6Kjweq9tXsnnXYqDuVjVGbK1BE0yd/GPs/utg+c+0ZIVslnw0fHOHuptsHTW36 mOCc20dgrWXv19YzHa2G224FlLl+fbqPjSp/WeUYstlw+92ho514+XoFPJjvDYee69zN DD6fIwzsmA8iGfQj86RtYIWOqXb9Lpvn8rPEzOeluCY+yvNo8MLx8C+1bqQ4folYdj5r cZ9w== X-Gm-Message-State: APjAAAUIxfSk0JTV+3RhZI1EXF6ANZmaPDme/7iWWc5KLOGa0c8jE/pa Ayj2KYbvYYbnCe23+phwZxIZzgUT X-Google-Smtp-Source: APXvYqzKWORUyKR02hmmgwgSBXHElorE6H1W5XXBt2KZvYRbjKsGNIgvPC43X5ooFhCQTxZLZvRgmQ== X-Received: by 2002:a05:620a:13da:: with SMTP id g26mr2059207qkl.20.1569271482697; Mon, 23 Sep 2019 13:44:42 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:17 -0300 Message-Id: <20190923204423.23824-6-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.71]); Mon, 23 Sep 2019 20:44:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 23 Sep 2019 20:44:43 +0000 (UTC) for IP:'209.85.222.171' DOMAIN:'mail-qk1-f171.google.com' HELO:'mail-qk1-f171.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.15 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.222.171 mail-qk1-f171.google.com 209.85.222.171 mail-qk1-f171.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.71 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 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 23 Sep 2019 20:45:03 +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 | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index 8fb00d0c86..06febacd96 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -58,21 +58,8 @@ 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->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 From nobody Thu May 2 05:56:57 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=1569271511; cv=none; d=zoho.com; s=zohoarc; b=ZdVmdYZ/DwLSBniXvq8Q9HPzOlLuBhOl/JbFzZfeQYU8jYcnPFA1k7lJVPFk4eDcjmsWqyi41iEW0j5N4COR8jbIaR71elWLikCmzuTTT3oaf/Sl7N2RBn3crrKUzEGHbjhbB1/euJd/IZQZ97nc/ccMh6iYEiA4IMD9xu3wWuw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271511; 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=sXWNUBp4r+Wn7ycojGgz37L4G+cPk8qALjxuYjkc62Y=; b=Jd+jn3cHJ30ZLHoVBV7IwQSvkBcBCM3VAWwmrtq5r0PDTVet3gxT7HZ34vpMb3IEhMofQzotc8kVSoOOj/Tcz6YdOxh8rwGIe967mLSevZsIFVLtJis89qXVPVwp+RFouHvFbHv5M4ZrOHirYkOLbxTWnh62JQAG8LAyBJm/nQk= 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 1569271511754871.0030397578596; Mon, 23 Sep 2019 13:45:11 -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 2B398309BDBA; Mon, 23 Sep 2019 20:45:09 +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 E545660471; Mon, 23 Sep 2019 20:45:08 +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 876E8180BA9D; Mon, 23 Sep 2019 20:45:08 +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 x8NKikmw031692 for ; Mon, 23 Sep 2019 16:44:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 101726017E; Mon, 23 Sep 2019 20:44:46 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 053F260461; Mon, 23 Sep 2019 20:44:46 +0000 (UTC) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.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 61E66308FB9D; Mon, 23 Sep 2019 20:44:45 +0000 (UTC) Received: by mail-qk1-f182.google.com with SMTP id p10so16919255qkg.8; Mon, 23 Sep 2019 13:44:45 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44:44 -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=J90cgyf4d1cl08U2Bh1dSZucwFfuTilNBe52PDKC94k=; b=ZqNFjxWFO1UrUzBGHr+7Hyu/qAUiQuBOE5m0ZP4uLGxm0RaRSybIZXGrQFB0rPHtCI YW7XSAqiUgH+5y2gyP1SCtsc6TOZB0LIcPmiEJTdHeMxPREXoiVmT3EkBfls38El2LKU 8Ro6F+FpTUJ7uz+iUeYkC6a+iX6Cubb28GYYhw5+unkHpP20wNE302/xs662s0owZJ7w YDkJhZoZN3PM0yaXX/x/u5PISvhug8LD7jTzpl5Owsev7ZSkyKkty69vMvHbsEcQqcnh qFbA2ewrY6dNmDQ0kKPVSdJs9FiEW7Rdm/6TsiXr6avrwRhhqiA1NRTvNmxfLV6bIZ3H rJGg== 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=J90cgyf4d1cl08U2Bh1dSZucwFfuTilNBe52PDKC94k=; b=NENNlkvpSYEjLzZU74dlbSXlIxmF5yMpndOI3ukhHVqM8wurV9oMUr1FP1a4AJSgmI ms2KkZIc4k2223PdMElFQDj8p0Pw4vIi+AViN0FgFgkFxSF5R80qzlErj7Rq8AaMdy+1 7tZ8GBJXyBh2EEYxBpUPBwlSVQRnIREfXiffVaqXviaD9xialsnij7ravTAWywfjHZg5 Pr5gPC4mJzs2RNuBQ6m5SXEgalBCnp/fgKd1NKL0wDfWgvtzRhG+/IVbmfh3iFOhWnp4 jRPwo5MWu30P1myqiJJUt/xBvbS/Yj874Y2v4e1mtm/ZyA2Uj2n9fPZvxYfCEU3BqXvA PwyA== X-Gm-Message-State: APjAAAV3cOlOvGx5HLr3r2xvfKp7S/VE9eakykNYLDGEghPLKEDJuao9 F2UD5pL9Ts6ms0tbirILJGWezZ/b X-Google-Smtp-Source: APXvYqzCs4/9xfyorN+8S/KKSNs3hMy+5anGc/48fX5vZjVALNeUkTEhd0DXj46T7NWtpeXha1H+Qg== X-Received: by 2002:a37:9c81:: with SMTP id f123mr2062906qke.66.1569271484608; Mon, 23 Sep 2019 13:44:44 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:18 -0300 Message-Id: <20190923204423.23824-7-danielhb413@gmail.com> In-Reply-To: <20190923204423.23824-1-danielhb413@gmail.com> References: <20190923204423.23824-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 23 Sep 2019 20:44:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 23 Sep 2019 20:44:45 +0000 (UTC) for IP:'209.85.222.182' DOMAIN:'mail-qk1-f182.google.com' HELO:'mail-qk1-f182.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.182 mail-qk1-f182.google.com 209.85.222.182 mail-qk1-f182.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 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 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 23 Sep 2019 20:45:10 +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 | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 7512a51c74..07ba679541 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -552,21 +552,8 @@ 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->priv= ileged)) + 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 Thu May 2 05:56:57 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=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 From nobody Thu May 2 05:56:57 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=1569271522; cv=none; d=zoho.com; s=zohoarc; b=H8qlKH9JQck8hkDt4qTLYLvNF9nOoOUqDCPO24kqiDu4Y4NX9Cl3KVlRpTVGPKGzeCwEuvOvzkFzRt+Yj+dAbtPGXk0taa/N50k8BMlD8ai8y68UVxtybuEsB+tCkG37+LvqFGhu3x+IfM9rdeCbD41jVuA7kWjqCgPHyxXZyGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271522; 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=UwIxid4vKB5IBWXa0QLKHizBWFrZHzjdrW+8VsIM6NU=; b=mfTx5yrww2ySR69CKoK/0QVHjiulyUHKgccxREGD6FBD180qLbZXTHdqbzabSLJ+hItHiodtcXxz9DIOJ6hAnNtjS1gwRequKbo++QQDgx8kaqOUjHe2YR9ZtOnkNzV3kHGGqE3rx4hohRuzpc5T9mx+phajxIEQNqIWDdRmNMo= 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 15692715220541015.2318424751918; Mon, 23 Sep 2019 13:45:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EEA1A7BDA0; Mon, 23 Sep 2019 20:45:19 +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 C70191001E91; Mon, 23 Sep 2019 20:45:19 +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 71B96180B76F; Mon, 23 Sep 2019 20:45:19 +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 x8NKjHFB031870 for ; Mon, 23 Sep 2019 16:45:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id AF03F5ED3C; Mon, 23 Sep 2019 20:45:17 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 387695E7B2; Mon, 23 Sep 2019 20:44:50 +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 7ACD231628F5; Mon, 23 Sep 2019 20:44:49 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id y189so16953140qkc.3; Mon, 23 Sep 2019 13:44:49 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44:48 -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=OJXoweaRr9Z8RLEGBeboRuSVoAanB+8tkRD0nOZ96a0=; b=Mc5E8ZfWYkw4R3wPxA1o1nz91CvCgt/vQfcgvAxXU/LoJK1LIApk1DY6XasE7ex5BH hO1kkgoH+eEqV1mpDCq2v6w+Op4id4PmJLk64iER9aUJqkGp+/MYjuXE0gFzNdc7G+sR vBmbmdEf8Cqjj3Kq7LATKEOv11SthvA3NycUi055VmBCyFZEXzBcCwMXh0x93bp9B8Nl jx7YAmhYklGc5PnuEXUXSmzlqX8/9H1C5oTIK6MNvIGQo7gyLYaNbFxX0R1zoKqKnX23 zQF7Ox+4QWd7/s2xCgfg6cCj+2lYSvozuDkqcLiNLC0ZY8kUhCnLyK5V/0NMJgygqwc5 7jOA== 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=OJXoweaRr9Z8RLEGBeboRuSVoAanB+8tkRD0nOZ96a0=; b=VclkmtFdaEeadvebBxYkTmeJUG8V/MMAtYayeALyxHQKDkvsvlCtSHLu8g7i4qDZ+9 z21MjcesQW54/0Sb/Jsihy5zJw5Ww9oM3IG0zvOyPfQVIa6MpHHP4cppifwHe9iMinn2 4kB96CdYGQSzLdBPdemvqGOHnguoHRd7lWdaD/Vj3Qbh30EUoPL9byKbW+kzKcKOO+jo lUl+1S9N9BQ4Kf36zthJRGLfPvFQNYXQiYOO0GXfMnplkFyT2ZJVKEc7UzEO/5KUHHyw szS6svcoS8ijj5VA06HyRtByxCydbNEHdmK0gPK0OfYjNB8n4IqQg3pf9ItIh8Eg+cs7 S0ig== X-Gm-Message-State: APjAAAWkki8MtX7v5SyVqB7pmIUBRoI+9V+I3TsO/B31hLuY+HmV1GgM LFPu7EBjEJuxFnkEzPQkugYdog8D X-Google-Smtp-Source: APXvYqwt6UZdGFDY0UYGggawwEdawTtRsvkz+NLfz7QLehDbgdp58lrPWWGVt4VuMyuhILipoHqBOQ== X-Received: by 2002:a37:8547:: with SMTP id h68mr1907452qkd.219.1569271488669; Mon, 23 Sep 2019 13:44:48 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:20 -0300 Message-Id: <20190923204423.23824-9-danielhb413@gmail.com> In-Reply-To: <20190923204423.23824-1-danielhb413@gmail.com> References: <20190923204423.23824-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 23 Sep 2019 20:44:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 23 Sep 2019 20:44:49 +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.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 23 Sep 2019 20:45:20 +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. Signed-off-by: Daniel Henrique Barboza --- src/driver.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/driver.c b/src/driver.c index e627b0c1d7..c89a410dd1 100644 --- a/src/driver.c +++ b/src/driver.c @@ -276,7 +276,23 @@ virConnectValidateURIPath(const char *uriPath, bool privileged) { if (privileged) { - if (STRNEQ(uriPath, "/system")) { + /* 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. + */ + if (STREQ(entityName, "QEMU") || STREQ(entityName, "vbox")) { + if (STRNEQ(uriPath, "/system") && + STRNEQ(uriPath, "/session")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected %s URI path '%s', try %s:///s= ystem"), + entityName, uriPath, entityName); + return false; + } + } else if (STRNEQ(uriPath, "/system")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected %s URI path '%s', try %s:///syste= m"), entityName, uriPath, entityName); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 05:56:57 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=1569271516; cv=none; d=zoho.com; s=zohoarc; b=PyDa57To1wQqlAnAT9Jl0jsHN0zzFEOiUTjI97mw0kfF58q0QigW1uUxjy3kxAeIzbQuix0ObFke9o6AOe7kvo426qUTSZvPSyTzEyQSmb6AYfzgB/a3YTf09ezLg32zXElBRcxn2VII6Wn6dVhMO+9WidYw2Cg2J2MBnM6O/FI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271516; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=RLrfUaI4nMqZ4/MYFL5qwFOG5z97X6EqmG2aYg91g3Y=; b=IP1kGTjgdLXut5cABO5GWtE9CK/4K8GMnW0cPuFh9zD47YME15N7a2LJOcGXEl696LOKV861vplHLjbCFf+vFbzrkUpvhYE0Mdjx0qAzVRADjlwK9YPMOLELHDaPHVDa6FooUgylHDAiB6F/4yX+VRTi37mBKLulRnvc/RKbFkQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569271516237420.51471475553194; Mon, 23 Sep 2019 13:45:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 75EF819D335; Mon, 23 Sep 2019 20:45:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 430E060623; Mon, 23 Sep 2019 20:45:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E5A1E4EE6A; Mon, 23 Sep 2019 20:45:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8NKir8K031733 for ; Mon, 23 Sep 2019 16:44:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5BAD2620B1; Mon, 23 Sep 2019 20:44:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5A7760475; Mon, 23 Sep 2019 20:44:52 +0000 (UTC) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 575963082133; Mon, 23 Sep 2019 20:44:51 +0000 (UTC) Received: by mail-qt1-f179.google.com with SMTP id o12so18888497qtf.3; Mon, 23 Sep 2019 13:44:51 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id z13sm5343974qkj.34.2019.09.23.13.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UHI56T4A8mMsjWus+aZP8pFFO5Uds6OLQdp9iQ9tZHE=; b=E7Bi2ZEcvoIN4TEn/+bolYedgmRCN09BuwlNr2KhGlaOnMZ5a5JSc6guPvwVjlQ/cV SEZ1bqIRX8c0GdwIYrqQH2kwBd3hsqYuffiEZQZuOMYcdwEr3jeLS9z+ZHMy5GDPowbj oWezn6Lh51FpVzc6yUgaFHJkWIv+7GEpgkN/IJulJh3izfhAZi1U4pydPj8YEO3PNlWQ 7n+N/t4N+wqaHR784mPn1YBBMQf4sK6MujxMpzhcVrhtjnzpJdt0Wgf/rdtumXpCENwL P/uT1MKvfNRuwHjrk6iFnqABpsK8C0txTJw+/smrcbO3QGsHWKzT7YI831Ps3ghwEf9L jVtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UHI56T4A8mMsjWus+aZP8pFFO5Uds6OLQdp9iQ9tZHE=; b=CdOmv8eEdKzRu5rjsKsvRtjUPV/nTwHqlTdge0MdpfOKgEgET6GA3yl46tMn7ERS1H mo9zHDIPO6axdZZeMc52cAV0AKSgbI3qNfvH5l87Gw1LWNnvJ+3NRaDLDgN4SAcIh0r/ sVqZVyMIiR9Lr+zLQ+9mJovoDf8OSwC3IwK1MmgZMA1Us5TAEdQwNRMh04ys8AIiEQfd F2fLYcbdXmuF5JDReXvYfgi+E/xbUS9xW+xgBd07oTOg6bAS4KpcT4VsOOHCSJA/bvLO basTXKf1k2G3qLkQtcGWEoIwSAbsaqtJ2C1aSVF/L7VDJv7uH6OORXeWvhyYkn8EQjTv KmIQ== X-Gm-Message-State: APjAAAVzTFpCX6S0PPPiZBxcBI+A/4Vwk/TpePY4xcCNMEOZrTq92J7M gVEThiNVbtNZdttVsthJf14gogSK X-Google-Smtp-Source: APXvYqw2ktqD2VFsWPouWdC8Z9JP58vjjwn5VzWhOajraw0kne7ljtWTNye434Nc4r+YnL1CiH7MDQ== X-Received: by 2002:a0c:ea27:: with SMTP id t7mr1085738qvp.103.1569271490489; Mon, 23 Sep 2019 13:44:50 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:21 -0300 Message-Id: <20190923204423.23824-10-danielhb413@gmail.com> In-Reply-To: <20190923204423.23824-1-danielhb413@gmail.com> References: <20190923204423.23824-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 23 Sep 2019 20:44:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 23 Sep 2019 20:44:51 +0000 (UTC) for IP:'209.85.160.179' DOMAIN:'mail-qt1-f179.google.com' HELO:'mail-qt1-f179.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.131 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS) 209.85.160.179 mail-qt1-f179.google.com 209.85.160.179 mail-qt1-f179.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 09/11] qemu_driver.c: use virConnectValidateURIPath() X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 23 Sep 2019 20:45:15 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Suggested-by: Cole Robinson Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f7f059b6d6..fe4d50c372 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1295,22 +1295,10 @@ static virDrvOpenStatus qemuConnectOpen(virConnectP= tr conn, return VIR_DRV_OPEN_ERROR; } =20 - if (virQEMUDriverIsPrivileged(qemu_driver)) { - if (STRNEQ(conn->uri->path, "/system") && - STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected QEMU URI path '%s', try qemu:///s= ystem"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } else { - if (STRNEQ(conn->uri->path, "/session")) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected QEMU URI path '%s', try qemu:///s= ession"), - conn->uri->path); - return VIR_DRV_OPEN_ERROR; - } - } + if (!virConnectValidateURIPath(conn->uri->path, + "QEMU", + virQEMUDriverIsPrivileged(qemu_driver))) + return VIR_DRV_OPEN_ERROR; =20 if (virConnectOpenEnsureACL(conn) < 0) return VIR_DRV_OPEN_ERROR; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 05:56:57 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=1569271509; cv=none; d=zoho.com; s=zohoarc; b=lfEjJJyQtBs9XBhRMglyV/ZQ7KStaPKePVbaWqlC9fnqOdasJlGMauWvLrmwfoLu0ULvj6h9Pi+75ezO9nKEKNO2+wcEWKVA0bVlMDq8xYYGwITbnwNQPMRQZG72a5qRdDm7tqdM+g3sTi5TGNYu6fkGXdzV5Erxr2iuWF3b6T8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271509; 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=EUQjmuP7cbxcWy/XdeXFlHjO6bjdfgTkLiCrToKxnOsZfCzWG4YSwkanTmDYhJ1glfHGdT8IxBeNPhSqdbWY1LV8oYu4hcvIvTR8+cQmQuk55cutjJiP9xwMPkrKkgaXNPRYQq58eZxPzWOVGJgbFWo5VOVcOl/JKHGBaV5JFDE= 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 1569271509561492.88493523042075; Mon, 23 Sep 2019 13:45:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9DFC4C057FA6; Mon, 23 Sep 2019 20:45:07 +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 6E8E35DC18; Mon, 23 Sep 2019 20:45:07 +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 0AEA54ED21; Mon, 23 Sep 2019 20:45:07 +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 x8NKis1F031750 for ; Mon, 23 Sep 2019 16:44:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id C89CC620BF; Mon, 23 Sep 2019 20:44:53 +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 8E23887A3; Mon, 23 Sep 2019 20:44:53 +0000 (UTC) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (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 D068586E86F; Mon, 23 Sep 2019 20:44:52 +0000 (UTC) Received: by mail-qk1-f172.google.com with SMTP id y144so16912801qkb.7; Mon, 23 Sep 2019 13:44:52 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44:51 -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=ZWwZyr4GnzplUgRmS44LrMIhQRfv86sGGSE1dZYGNt2JcKX9pREwmc3a1xHGEego/7 rBnQ0q/+S5RGGk4S8XoDSOTune5oTNXKGg5CFXZ+HfB9KFcktOSskuo3FovDJbrHU/xd imotH8TtcnIfR/IwCfjznY50LuOMlHKNTNM24hhaXnJ7fL47T4dXJHm2/JjncL3oracl R0I+ngtGRmrwlMHufpvg3azbMNHHAGG1JUjD4D006AHN2sjs3s4LuOJdigM3q4dFI3ti bpgMBIThHT4UCvhmUEMn9BJBvdP0p8jRBmv+Ijw0RwjoUPSDxSUpkAlG32bMkjgY+gt/ sa7w== 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=kjtYW9hpesWm3haTQh6zNCdV1bgpUhTUg7fLy7Jc3KbHBp36ZVrm3yTMY2bwjctqsc F8OcCbE89LgXvxwpCbhdTveEhaZyR8Ju08MiVXljNekvdP5gIMz7vmSoFlUluvlP4pmB AL6PJN17UEw7Dbzwi5FeWSC06mr47jH5dHab9qY4QWDx29VU335A/ZWaUUF363Mk5rXW U5xIq8L6+ZhYrKbDolWDQfEycJ45KGeJOO5Nuge+9Uzhreqmf/T54tudCPWxdBWt0sXd 7OkJtfdmL3Fs3fls/vLGInivNtqomO+Wsfz0TOL56EVIp2uZo+4hnuCCG9rQS+5MHJy9 KtwA== X-Gm-Message-State: APjAAAUsuhlxk54Dl+XANZuBduyePAkeaaVHlzXseTZmqUQ2rxxDZh5s N6caSvmY/4VCVL77WwkGa/X6dpLD X-Google-Smtp-Source: APXvYqzblARz9tUkXtZ1E8TVCcRSKZ8j7qmz6bi0s4Y2PaSyy0BywSL7DvPB4ZRm4PMA6hN4SIesJQ== X-Received: by 2002:a37:bec1:: with SMTP id o184mr1900394qkf.479.1569271492024; Mon, 23 Sep 2019 13:44:52 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:22 -0300 Message-Id: <20190923204423.23824-11-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.68]); Mon, 23 Sep 2019 20:44:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Mon, 23 Sep 2019 20:44:53 +0000 (UTC) for IP:'209.85.222.172' DOMAIN:'mail-qk1-f172.google.com' HELO:'mail-qk1-f172.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.172 mail-qk1-f172.google.com 209.85.222.172 mail-qk1-f172.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.68 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 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 23 Sep 2019 20:45:08 +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 Thu May 2 05:56:57 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=1569271520; cv=none; d=zoho.com; s=zohoarc; b=AwORAwp6CZ2dkeCQljma7WlbDJuHOHW3ZDOPQXQZuEOSU+UgnSIf0tIg0vTu/J/6CvmL92uCnPk7jULoJppha6kZIA7WRWANMcMyeGUSQWZaoCsgas6cbpYoDcD6e6UzkDFSHdY4lEui2cSus0oeda8KCBGrYGrbGy14MGXiZAg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569271520; 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=afDzR0LrTpJCqRYbf0+IEceiUObtmcT79j+BTldPDiQ5NtDFHJQMusl1n1NNaT9Pr/o160vR8HX0tjpoqJW+gE8ZJzRWPLXQul9R10cIoc/nHP81yCJQ1mRnfFPb/JHJ0s3xbuvvwaFspjfoPK1AQQKrzuPDmo+bpdEKwNEX5Mg= 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 156927152072326.067855657222367; Mon, 23 Sep 2019 13:45:20 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1675A10C0940; Mon, 23 Sep 2019 20:45:19 +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 E25804A7; Mon, 23 Sep 2019 20:45:18 +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 8BDB31803518; Mon, 23 Sep 2019 20:45:18 +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 x8NKiume031772 for ; Mon, 23 Sep 2019 16:44:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8488360BC1; Mon, 23 Sep 2019 20:44:56 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32B1D63BA3; Mon, 23 Sep 2019 20:44:56 +0000 (UTC) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 07E243DE31; Mon, 23 Sep 2019 20:44:55 +0000 (UTC) Received: by mail-qt1-f171.google.com with SMTP id w14so14407941qto.9; Mon, 23 Sep 2019 13:44:54 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:44:53 -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=TXrMX/kjtYVAF85iE3Kkp9UtO9QADGddzok4xvAykZAh7V+KHGP4p5FrzkyAX5FANY CDdPAFjkooHOpkjgnU+rUeK6/vtnBEbCCFQsCkhpaKXzK9+BMAXln495AjQ6sn6xq/Gp 4id0u3E3xUvIsi5dm988wztBopbdJDRa0mSohChlqyyUG97iDjIh72bN76eD4c6p6SUT U2W7laErPNSnYMYDLm9dhNy9R8U15RuDp3lLBN6BgH2Qm2xkzSC5/L4k1LZ2ke03bjem g+7a0zn2oAoLtOYVYP8nCAG4rmrRru86ZfFMu8Oz6UfiuNTNgKKwiizXad6jMz8PVTNG a+8w== 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=czZWD86/+ybO9tERNerWCjJuGVzL15ipsno75EYjRh+5XZaSCW9ZEdhjVbE9jtAXn5 NZ6d8oXmS8q8s9XDyY+WbsEnX6LTGnLraMUY4dX7SL7cfFyJGDDdzrS1a7qJEe9ZaO4Q XgW8rKdUTiBkNIVytaLzRtiIkgpzb1kduuB12ISacxnn2oYuD/QWcwIoBD6IvSEAeso+ hmMN/7xJQb6qVjtCWd5JDu4eGLTAyg3aVX+HZI1b0qHsBjZ4UoNVeQpodHpTA/rtqSd+ 3UM2c/jafIWV8TycqVO2riU1By5NwkkZz8bSnUcYPMJHVYZYyOXffDXBMwmmsPv9Bph0 Iq7Q== X-Gm-Message-State: APjAAAWflnjB54/RLdEfbYMRVQV2zcafCgTB9+2yUkfoqDO1+H2JQ9ye 3WGStZsX2ogW1df7AAP8TWeAmWRw X-Google-Smtp-Source: APXvYqwlEzaLm6i4AElcakXCu/kYrokizILPmcvGC6nC3YEsPbFrFo5+vKNoNWYZxqsyyBWdYx7vgQ== X-Received: by 2002:ac8:68c:: with SMTP id f12mr2042385qth.252.1569271494250; Mon, 23 Sep 2019 13:44:54 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 17:44:23 -0300 Message-Id: <20190923204423.23824-12-danielhb413@gmail.com> In-Reply-To: <20190923204423.23824-1-danielhb413@gmail.com> References: <20190923204423.23824-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 23 Sep 2019 20:44:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 23 Sep 2019 20:44:55 +0000 (UTC) for IP:'209.85.160.171' DOMAIN:'mail-qt1-f171.google.com' HELO:'mail-qt1-f171.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.15 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.160.171 mail-qt1-f171.google.com 209.85.160.171 mail-qt1-f171.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 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 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.16 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:45:19 +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