From nobody Mon May 6 12:14:18 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=1569247455; cv=none; d=zoho.com; s=zohoarc; b=ElIA9MTPJ4zu5A1C6QhnPyEVqUDgbY/BOSMg4V+lz+R3Gs+9iI3peI6oKfolOGmdcRjSqt6//V1TG/cGOgZ9yq4QAVf1E+Scxa9CA31SiiJN00lm5ErNIdfnglp3p9UsyW+ogYYGmzgbZzwOXYDPDWfY8V2cHDh/cMIcTpE21+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247455; 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=YiIY7rTmALnv0u4Kn+dXpatQ5bNhnSdWWbYoml8on77WkK06rd5tziukf+zMi1hMaoeRrGBtUzreIWCFKppkwyoZ2f1a2OlX5gQgSNv4lQeMiMYFJxGjjx3UeVmFt+gf9mwMhRXB+EEOlFLBm5QpemetpDDM+Z/u0572lsgRJG0= 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 1569247455637592.7674395943925; Mon, 23 Sep 2019 07:04:15 -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 42A7E10DCC84; Mon, 23 Sep 2019 14:04: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 0BDF610013D9; Mon, 23 Sep 2019 14:04: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 A05254E58C; Mon, 23 Sep 2019 14:04:13 +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 x8NE40h4006920 for ; Mon, 23 Sep 2019 10:04:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7D7C310013D9; Mon, 23 Sep 2019 14:04:00 +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 D31E11001B07; Mon, 23 Sep 2019 14:03:57 +0000 (UTC) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.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 AB8E1308FC20; Mon, 23 Sep 2019 14:03:56 +0000 (UTC) Received: by mail-qk1-f181.google.com with SMTP id z67so15452572qkb.12; Mon, 23 Sep 2019 07:03:56 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id o124sm5298435qke.66.2019.09.23.07.03.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:03:54 -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=jc7tlCYemdH4WygZEtelUZyi5oCdX98qTtvTV8AANZJvwq9ugsy880ag5KoRZl4V10 xqUU3XwZPM4JLpCXI4hIrhBpKb4OKWTk3w6G5AV3V+ktE3PTAr/Ne1XQ/Sa3EZCLRvwr wuRSCWnw5yvGOWHXHgKJPyjPgo1pf/UHP1TCXZri2SJMVC6ewmOqeqVdxZgOCJobYAex IkjVyoqLIaVhmiWAGV9T8GqyxkuA6DK5tVVIHfyUmpc+ATL+C+xnVsNJDj007qGo6fBv ctNBtzfOI5yDa0MtDufnez+8iPPI+yuU9DIDe0WhY4hTeD/vc3S3htrHfW6z8Ez+jDtE CPCg== 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=YzJCnbRwflL+RSnl+5XQhUZghhxwo04o97g2D6XHGKgr9/51hj69JHs2ow7sR1ENH0 5jr6WoizoTdH2+zTwAUaPAn/XaDiwGoyPo6n+vvUuFUBbKIUimNbi4L0MVFZpQSq9tuu pM7Zfa1r7wicjZRpaLu4tjJFCtAQyg+bNkCAWH6Icq8o/c/v1CKleNUnlZZiaBiH03cz M+0GKB2rqWXxfxx0BDG5STB6HLfxPHwQCdWZ3RhE0rXhdiwXiRdRgBS/c+1+EE6mfbnF 5zTK+LVKzQz7UbMGADxBV2Kxdry21ZV5eMnKm/vOIneW/UKoRd9kuYcolcOHJlzaYV7d MckA== X-Gm-Message-State: APjAAAVR0ZhALEn/hTPg7h9CoxMdwOWDuRHbMOYx8AzP+5C7wmvatyhI Cwt7mPBKj0+prIl+FF2PKY/lYygc X-Google-Smtp-Source: APXvYqwKYdRf2WG5fDOFUhEYwZW4dJAXjwe3Q/I6n+WenP0xP1KUWVeeFcY8pQI1owBoeWGIoaGJJg== X-Received: by 2002:a05:620a:4c9:: with SMTP id 9mr17919823qks.235.1569247435505; Mon, 23 Sep 2019 07:03:55 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 11:03:34 -0300 Message-Id: <20190923140343.1950-2-danielhb413@gmail.com> In-Reply-To: <20190923140343.1950-1-danielhb413@gmail.com> References: <20190923140343.1950-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 14:03:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 23 Sep 2019 14:03:56 +0000 (UTC) for IP:'209.85.222.181' DOMAIN:'mail-qk1-f181.google.com' HELO:'mail-qk1-f181.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.181 mail-qk1-f181.google.com 209.85.222.181 mail-qk1-f181.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH 01/10] 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Mon, 23 Sep 2019 14:04:14 +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 May 6 12:14:18 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=1569247445; cv=none; d=zoho.com; s=zohoarc; b=ZnXevThNfCedQnr9cxXoM97MzjKgGdmRf1jRJTAeTVTXdWKzvlQ2O699WiOksW9t8zVOqH6TKcA3KoK21guBCHcBWdzXia3r/IY+Bi0BE1wh/ASHHCAXkaKPOshKYJhGLaMB3PEYSPpU+0JD5oYzZBJcsWaMJxGHHIZjPga7Sew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247445; 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=BWdUyn6ruwDHrqUcgI7A8djRksQJ8kT+PgVvdpjhH6IOX2cO5PEHEkqgAEGnwjhGPSl9JNYX66wtJnBA9LZhr+v8YH3NEzhBTsNGcIP9Ius3nrmjj4MRNYSgoo8fNjRv8QhCbucOmgkMllLTJZIupcqLTmclfE08nXzZK+ZlSrs= 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 1569247445280735.0587816638256; Mon, 23 Sep 2019 07:04:05 -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 BEE70C04B302; Mon, 23 Sep 2019 14:04: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 957CE6012D; Mon, 23 Sep 2019 14:04: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 1DD6F180B536; Mon, 23 Sep 2019 14:04:02 +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 x8NE40jf006921 for ; Mon, 23 Sep 2019 10:04:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E8A91001B20; Mon, 23 Sep 2019 14:04:00 +0000 (UTC) Received: from mx1.redhat.com (ext-mx22.extmail.prod.ext.phx2.redhat.com [10.5.110.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 26C6410016EB; Mon, 23 Sep 2019 14:03:59 +0000 (UTC) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 6EF6318CB8FE; Mon, 23 Sep 2019 14:03:58 +0000 (UTC) Received: by mail-qk1-f177.google.com with SMTP id p10so15466491qkg.8; Mon, 23 Sep 2019 07:03:58 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id o124sm5298435qke.66.2019.09.23.07.03.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:03:56 -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=a7j8tmwmGksU2KIh546+i+MyRUut5dfoGtrb0Ka/GKgV9ADn4NyGZQpZ7LYUUZlNvJ LFfjeNA714VSH0J8Y/u0z2gehyNQz1ic3XSBhQS2oX76QjWS8ifEGY+2CFaEzyke+GTH IPl0RU0Yd2sp53Pek7pA8T1ZEOv0M/I8CGZhBCG/5PvHKf4lfTrwFxmDf+N1ngqN0zk9 kq8YyoCEKlPwlD9vienGqpwUg34rGazZaM+EQFnARkaZQel6BXXVqekPhQUR8NWrYjVc C+N6STbBt7hNIcxtRkXVFZEr0Mk93gdgeXZ8oIcg4B6bu5ht9ZNzfkMqssmi39Wi7PG8 ABeQ== 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=gd6r1yHQTLD+3MQUtIehVqCSBwzCi55H/XZx4LKXSJE2eNJP65QAw40sMDQeAPlPS1 gErIGYrDkIJPMotp4y57HC9LtmQOfT3dwyyqNE48P4HIiJClBbWgzXjP/FhC6NBPHOCJ +KQqjIks5wdYVhCf4mQa4zEl09BNbhV0Z2pU7wRVkgZrTOJAvYmtqtgvFvB4bioGA7Aj dH5Y7KE+/sQzeB0IxGPxyuppXM4+c6F04FKCv4f87mgeWcEYuuCUEeFBKMg5kbIJO0P2 NdhPl4FIcSqZEt1zeMxiSZEewuSam1oh/z1CGc11OmmsNNiY5Rd+y3qiGNj80WWIEDkS qVLg== X-Gm-Message-State: APjAAAUMz7gUmHPSl8/opYCpYHnS7R97LNdAFSsRy5ascm3U84M/G//P BrPUl8tZ/zrMinPyp9DjNn0YK3jm X-Google-Smtp-Source: APXvYqwEp6vQzVwRbklvH3v1Sz+3TnJRqucn6YuMh8+q/0tPNnq5BpHip8Mst1W04ahxAfR2gZNYWw== X-Received: by 2002:a37:714:: with SMTP id 20mr17253120qkh.32.1569247437506; Mon, 23 Sep 2019 07:03:57 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 11:03:35 -0300 Message-Id: <20190923140343.1950-3-danielhb413@gmail.com> In-Reply-To: <20190923140343.1950-1-danielhb413@gmail.com> References: <20190923140343.1950-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.63]); Mon, 23 Sep 2019 14:03:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Mon, 23 Sep 2019 14:03:58 +0000 (UTC) for IP:'209.85.222.177' DOMAIN:'mail-qk1-f177.google.com' HELO:'mail-qk1-f177.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.177 mail-qk1-f177.google.com 209.85.222.177 mail-qk1-f177.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.63 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH 02/10] 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 14:04: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/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 Mon May 6 12:14:18 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=1569247465; cv=none; d=zoho.com; s=zohoarc; b=aTQT+ygKNw7PeyJbzTri297VdYffKU5wCjZFCU/2OC3BA5lyOwVEyl1AzdKU3DcVHqcHloQJRNvSwqlMniTypELulDy5EiyH50PWtC6vvHvb0V3DdCBQNNLgUJ6ciN6oRRuhI016vsLgcuwm5LeKB8RiJXPFBlRne99OLkPL+Lg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247465; 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=NoGfHuwz+qPsHioT/2sniiYLowFYBuv34Dg/DrVeqYNN3HszTu9Zb1ofbVjTIPoUFfTfe+w0BqHoGvRqCHFEvap8Cct3faWFpfyr8m+Ixd/3sWAVllp33HWJGsXEA5zk2u6VfeeLsFXOQ/4F4/iqqUp870xPksfFy+Mgsj4r4rg= 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 1569247465772763.6379970604469; Mon, 23 Sep 2019 07:04:25 -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 A66B87F746; Mon, 23 Sep 2019 14:04:24 +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 79D34614C1; Mon, 23 Sep 2019 14:04:24 +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 36B0A4EDA7; Mon, 23 Sep 2019 14:04:24 +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 x8NE42Jc006934 for ; Mon, 23 Sep 2019 10:04:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id A6BE460166; Mon, 23 Sep 2019 14:04:02 +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 9DAF3601B7; Mon, 23 Sep 2019 14:04:02 +0000 (UTC) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (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 F1B4D10DCC84; Mon, 23 Sep 2019 14:04:01 +0000 (UTC) Received: by mail-qt1-f178.google.com with SMTP id x5so17252906qtr.7; Mon, 23 Sep 2019 07:04:01 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id o124sm5298435qke.66.2019.09.23.07.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:03:58 -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=TBxEQXWdepg3ivP9g+JDM/fGXZvqPNSe7czLTm+O+IgAUsHnIIbH5/foPxPDsaja99 PmasSeMSIEh8Pd7CE8m8vVX9+c/kORYu+GbDM38m8FevcevEbbbA2JMCkJttuMLna3ga 2EMl5wWykxLyWtx2w5r4mXvZnU7DV111VUpiCycUIvr+pS4zXI+wqeKaY++lGgXaowP+ TEvkN1r55o/rYRwMaU2yPTdv/iixSSu7Zi29u/LuWMtb0T6JmUiTxL4mgardv8hmVn6H nm2ozmCYOjxZNLXV+IqG8VQav8hPIEz19qE4tFlL0jZbQokIjuvkKMgUfe68bNRnU//Y j3aA== 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=IAtg0/FkPlAnXvThWzY2kUSSKYEViJkRTl0LCn9VaWFIGo0eUQq5cqwbD+XbD2t8Xr +APVXbDgXwyyeeXxqrWQK5hRRAIkLseb0sXyT/xxbXKeXcSd/tEY+eWII5wvA8qKJoh/ w5wj6Vh6np9cLcCl05YTue1XKCle0yZcXeSn/h0c94UXt0y/nncU8lF6O/pyywJcUBLy fO5UvH3kxY1IYPmerAiwVSr1H/qcJ/Vtbi26gBWXDbKG19ZK5K3vdk8fFwvPY39GGM3l fHqvsSAq7UOq3gOrmbhfJ7HH9ZKc5S+ZNuAhAwIS7kvx+iRXgpeNOCHWsjYfZfWnkWxt ufiA== X-Gm-Message-State: APjAAAWEOyrFSjfPppqD6aq9yuYFIZjze5cqmEXCDUlw2+aqShSuuCoX VjIN6JkCbqOJZs1aK4aXaQxCwJ+g X-Google-Smtp-Source: APXvYqy1CdimGvHyyaFXhoveJnIlqHzimOXxIwobnETpuu5/uVNX/efAe7wr610NGe+GuHmNwr0fXw== X-Received: by 2002:ad4:458d:: with SMTP id x13mr19552734qvu.85.1569247439190; Mon, 23 Sep 2019 07:03:59 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 11:03:36 -0300 Message-Id: <20190923140343.1950-4-danielhb413@gmail.com> In-Reply-To: <20190923140343.1950-1-danielhb413@gmail.com> References: <20190923140343.1950-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 14:04:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Mon, 23 Sep 2019 14:04:02 +0000 (UTC) for IP:'209.85.160.178' DOMAIN:'mail-qt1-f178.google.com' HELO:'mail-qt1-f178.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.178 mail-qt1-f178.google.com 209.85.160.178 mail-qt1-f178.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 03/10] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 23 Sep 2019 14:04:25 +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 Mon May 6 12:14:18 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=1569247451; cv=none; d=zoho.com; s=zohoarc; b=HTSQ3xbL2yfRfHBeR7Tu4W0/5v0qqQ2L+KM95HquANn+9tQIhpzMdfGqyv1w6d1fq5LrYjdRn3OW3xuj8Qt3RcKy/OL5KYmTDQ97dgTqJhw4Luznupd7w23CjpmVX8DvuqL0D+Z047Neeb7Ugr5cY45XBmrUFClMC7zXfpHk/Xc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247451; 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=Moz1BDERMtp+vWFKkcy8FjVbzsESAv4pfSntNSvjeVzpiGszC5KT7w4+kdTFc015ccoLv5VQ9wMYcDG7QpKh+xB3n5TlRy9v+Emvv6oxmL6ViSkb8EsnEWj+DRjQD3U9seMqm+DQZHfMwKtrvgnQSXyRKa/vZYZjHxCygzTUWcY= 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 1569247451625737.8441968642823; Mon, 23 Sep 2019 07:04:11 -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 491D5800DF4; Mon, 23 Sep 2019 14:04:10 +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 1A32F5C207; Mon, 23 Sep 2019 14:04:10 +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 C93D2180B536; Mon, 23 Sep 2019 14:04:09 +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 x8NE48wl006961 for ; Mon, 23 Sep 2019 10:04:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 33A595D9E2; Mon, 23 Sep 2019 14:04:08 +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 AEAD05DD6C; Mon, 23 Sep 2019 14:04:04 +0000 (UTC) Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.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 806CE30603AD; Mon, 23 Sep 2019 14:04:03 +0000 (UTC) Received: by mail-qt1-f172.google.com with SMTP id r5so17288645qtd.0; Mon, 23 Sep 2019 07:04:03 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id o124sm5298435qke.66.2019.09.23.07.03.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:04:01 -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=UyB/nT5uiAsip5QnBoOUghV5zxDHaTLxsrUrzH4MdvY3tRPaEoFlERWwEN4OqCFdZP YG6OnPKZK0tbVWYn2wpTenNNxuF0VTizSsTJIYYNCWBCGoe4vVNBY06gkeCbLuH+j36P j8YjWl1D4Meuy+7abxjdWectNcStUjZwJa2SJIEFoS8oJVWe6dZk1hn0V62J6tl55ivd xyANrYicyQ3aMzc50e18lX5e59PPh1GkcvZYWdlsgK/wCIpnU9UtoE41k0jLwYFxlOPe iZeExxver1DhiT5FF6vsJBWCUXycvAO7ITNdVlkGrSk0O3htBClb5PGqO0AZwnnUnYQr kUfA== 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=J7cXk2mOxWNmddPH9EZYgJBb21rEETYkeDZG9TkVov2yxe6Nc+xFziloJ5zQXsX7P6 CuDqGw3goQPEZjmmNSX7/9fsEn5yabqaNNTsE/SAq6cU0NiInJSjQ+iT4OoaVS7yaACk X5vFbIDVmxiL3yQnAvTTF4gP3/xMItySK1CkroWmBHUT4GdIFu+y2CZGwZmXvKW/Kyff ko559ldexVFXZ+CnmZWK7xeV2FamCKZ6gDsX06484TIbYv9xPKwcIKqZOb2bCulpEJh2 nDVHFbZ+7b2Wh0saZXYVSKjTuXeIasBKg5s5+emQZjdrmcs1TllN2blICppfduHMjv99 tj9w== X-Gm-Message-State: APjAAAVQUYrh++lJrLs6PgBL1qB5ghYGcYRHgwnkoris3DaRELNTBcDu smayjx7OXQkqdi3zHqcpWbx3FVBx X-Google-Smtp-Source: APXvYqx8+kyHsWT03NcCvqsfZg/uaQLgfUlCRT0p2iBzSs6ZGRhgfMt76KsrpdlZPHYvbuEU6HBxRg== X-Received: by 2002:a05:6214:1369:: with SMTP id c9mr24730141qvw.3.1569247442423; Mon, 23 Sep 2019 07:04:02 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 11:03:37 -0300 Message-Id: <20190923140343.1950-5-danielhb413@gmail.com> In-Reply-To: <20190923140343.1950-1-danielhb413@gmail.com> References: <20190923140343.1950-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 14:04:03 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 23 Sep 2019 14:04:03 +0000 (UTC) for IP:'209.85.160.172' DOMAIN:'mail-qt1-f172.google.com' HELO:'mail-qt1-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.160.172 mail-qt1-f172.google.com 209.85.160.172 mail-qt1-f172.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 04/10] 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Mon, 23 Sep 2019 14:04: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/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 May 6 12:14:18 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=1569247473; cv=none; d=zoho.com; s=zohoarc; b=HJUyTkY3Ec5wZLeivl4SNRGzgMkq2VBSaRALlnYXE+V+ogf96cOi2Gy9thDHvi1vRY+yrx6eHuzoq243pJWvOK4TXiKgnk/iJE2MQ9g++zkLWfog8FM5/1cQnu/IsO1fkeKi8PPmRw1ttlwbAyn3/kHMmLcOGXfmR7KaOd3wbCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247473; 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=JdkqI84T2u2dIrwoI2KEx1ogXLkHkRTW7uFzU4W8leT19ExGFxfNjGLMmowXUCEN8hmiPlzl3AkYorB6z7vHLu/voeeL9pqlz8jFC4kPCXQnKNy2U1ngcTC1Q9IL2yrD0GwJ11fcJhXSsBwlFIR+MuFv3BQqrfuFBArxPbat3Jc= 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 1569247473513544.9330175179867; Mon, 23 Sep 2019 07:04:33 -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 02B0330821BF; Mon, 23 Sep 2019 14:04:32 +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 CFF751001B13; Mon, 23 Sep 2019 14:04:31 +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 913DE4EE6E; Mon, 23 Sep 2019 14:04:31 +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 x8NE46I0006953 for ; Mon, 23 Sep 2019 10:04:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id B1C791001B12; Mon, 23 Sep 2019 14:04:06 +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 A906010013D9; Mon, 23 Sep 2019 14:04:06 +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 CB60CC057F2C; Mon, 23 Sep 2019 14:04:05 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id d2so17269047qtr.4; Mon, 23 Sep 2019 07:04:05 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id o124sm5298435qke.66.2019.09.23.07.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:04:03 -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=HqdnqCejdc3fnFF8kM9BsHbu79Zh/5yER3EAGJlRSShuCBE31yeas0LMIwVJFdxq8m XrwJFub4D18ZBL2e7ILtbFnNVTImSSmXo5oJ48sUyF55mp6x2xQ+7nCk4N954l64pbXR 6j6w1PtRGofoH7GpVAZGYwlH5hr9iw1+SVi5OHvuxYcs1AH+WFYhkQ7tJfBTauM4fRWH ozrQRJoLFPAAh7gYbGq/YfUVL8cOy4Yy8IzFnwYd79dI3RfpHItl/cpilyqZ3ecqAzVT YgZ24lfPjpwpzOf/DQHjOVqheTkI2wQd0KtsKTgtWV9GVqO0v/iksKELo+bVnWfcK2e6 ARbw== 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=M5NWStOHYb2DP0+UpabpCLpUkmY6KSqtDuTCwrOpWaOYlW9HMhDnnY0rgDbbxK7Yaa A+EAZebRlfUpqGjjz5dQFAxKjnquNHpiAmaYNdow7RV9LLRUackNmaOu+EAPlipdS7Gp kWG/Ps2/Z7cEE/zSQOQ3VxDLf6u3dY2EkYEBwe0OXaaf2kRo9Eaz0EtOgEgbkqkOkVoF 4MvnKpsnqbeyC53NfSWPVze0LFA5abpiRj8fvm4+tQwDebeu6TK9vIGNS8zVaQ6MfLYY F91AAXgS4Xpg/3bq6MRdg/8dfwrFOCUPfzAiFn39lO7ptgGP7HX8acRpBmYU1pi8GeAq a54Q== X-Gm-Message-State: APjAAAXvCgHAjNg3HB6d0glVUHIfaMiS1U4l7Oak3+iyW0w9KXwkVfxs Z8P07/ZoWiLupzdTA/LiJR7iv4H4 X-Google-Smtp-Source: APXvYqxIXpd2GtBSx3iY2ITDd4Lx3kV8w7iNZ3mAoHaIHQUOAbxlbl8KaNGLapQjiEuBCp7Y4/dkYw== X-Received: by 2002:ac8:27fa:: with SMTP id x55mr23946qtx.241.1569247444645; Mon, 23 Sep 2019 07:04:04 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 11:03:38 -0300 Message-Id: <20190923140343.1950-6-danielhb413@gmail.com> In-Reply-To: <20190923140343.1950-1-danielhb413@gmail.com> References: <20190923140343.1950-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]); Mon, 23 Sep 2019 14:04:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 23 Sep 2019 14:04:05 +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.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 05/10] 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.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.47]); Mon, 23 Sep 2019 14:04:32 +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 Mon May 6 12:14:18 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=1569247455; cv=none; d=zoho.com; s=zohoarc; b=bqZD+aB4LUiZXN2IyEy4aj8ESgA9CfH2831ujDWzbLQlMH7nN2Krb1W3BCmTkRgJ7EvDmAlTf+Yjw3Dr4YM8ZlR6G8jX6PdkhPqFZKTQ4ENOF6T2dbS20heXVPDF287dyW6KtxQr6tsw3mNVxqPB1FqBH0e044w+RHDtIUzm6XM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247455; 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=Yzp5NC9uKEcwx/nMQvdrGOF815uBro/CQo2i66nmas+cReTaihbS3c+1BlquRZwD9W/9c1JY4SFBl8OZrJG3DuFwce+p7HBnk9miV8C4FVh9LzuXYvlUq0h21hn+B0/hwXde2djlJmBCCCkzTZREEYwcbIsK8r5uNpGr7xsYIP0= 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 1569247455683433.7247169544331; Mon, 23 Sep 2019 07:04:15 -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 4600618C4274; Mon, 23 Sep 2019 14:04: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 0F1FA5D717; Mon, 23 Sep 2019 14:04: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 A54144E9F5; Mon, 23 Sep 2019 14:04: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 x8NE48OD006969 for ; Mon, 23 Sep 2019 10:04:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id E95D4601A2; Mon, 23 Sep 2019 14:04:08 +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 E05C060166; Mon, 23 Sep 2019 14:04:08 +0000 (UTC) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.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 C22BE81DFF; Mon, 23 Sep 2019 14:04:07 +0000 (UTC) Received: by mail-qt1-f175.google.com with SMTP id 3so14802145qta.1; Mon, 23 Sep 2019 07:04:07 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id o124sm5298435qke.66.2019.09.23.07.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:04:06 -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=VVLN9mxmMdL9VvCBSuBriNdHxJv/vdiqwl8oYw0X4AKq4LPd9RkGY2R52oT2Iz0RDQ iFBh99L9GCUn5mK/YYIJbDhha3drY9nmPWUXjYhOS8Zb8h5yb9sDapq0reP9ZcOzdvtw a/3F/rY0x7WNuv96siWjPwZfRelCbIhhGPmSMrbtq1ciOulADr6ru9sgsePLDSvdD1Nz iSpM7Xs+7rdeb7M9NKQCpo+6pvaXVs1VfJrmkzDxpLoSbzYloYTe7JzZvL/ygRxlI2Kr +0Leehdc2B/XwhyWfSUkPXCXlKYyb3CQYjcgMYoWphKLJJ7cQLpF0iUBsuNAnplCPDNd lIlQ== 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=nEE/ypqUU1DIzGMR6QWAaU/cr+SJM0/DXJYRTpdZloNmwTHdNSLrCk+rLRtJ5IM25P YqYNeCTejTtQR62zB/jXUQu3RccWFEMUAhWIecv4CHYG56uIRauKk6KkYVVoQ/U3Q3g7 BwGPePbYXHxYKXAzC/NOg9oX/qaCCxkh7Ws83lBMO39zS4B3vT3SOm2HiAzJUZATim6x b889r3OzWJlDdJ1gT97Ku99Nbvub1oSWSzfEVbykyRhmyvt161ArL8zigjj9VhupM8d2 f02Reg8pM3cO/qucrEvnSJn8geuAmXtoMoZo9UdlX6FCZNlfevTORokECuc0M3sGsnU2 zT2Q== X-Gm-Message-State: APjAAAVkvzDsfMfdJtbtL+uPNeg3tj7AqjLQpFevTnYvGI722S/qwgJp ZvmnKFkNSitA4HczGHxSkCbKJswN X-Google-Smtp-Source: APXvYqy/+JOAToNlWIctq3x3W067Clsj0lypJIjQk0SMfb5Jhuk7rZhJKVXIlYxxGRZ2/AK/8LhZdw== X-Received: by 2002:a0c:bc15:: with SMTP id j21mr24729372qvg.234.1569247446713; Mon, 23 Sep 2019 07:04:06 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 11:03:39 -0300 Message-Id: <20190923140343.1950-7-danielhb413@gmail.com> In-Reply-To: <20190923140343.1950-1-danielhb413@gmail.com> References: <20190923140343.1950-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]); Mon, 23 Sep 2019 14:04:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 23 Sep 2019 14:04:07 +0000 (UTC) for IP:'209.85.160.175' DOMAIN:'mail-qt1-f175.google.com' HELO:'mail-qt1-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.160.175 mail-qt1-f175.google.com 209.85.160.175 mail-qt1-f175.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH 06/10] 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.6.2 (mx1.redhat.com [10.5.110.62]); Mon, 23 Sep 2019 14:04:14 +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 Mon May 6 12:14:18 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=1569247465; cv=none; d=zoho.com; s=zohoarc; b=F9qTK4Y96G+zsSUr+T4G6JJeL+X62BdIBLMrEk6YpxS41I+jtCXFCk/jzT7Sle8Bd0xb/ZSHCy9ZIUXKwVDSBPrbp6OEXKMlb3uQ5XRU1mV6N7S8nV3LKbaOgkbZqS0jfpLDgmcJhmfSSE6uZU599rT+1Ihx+/AW2sz9dEtU75M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247465; 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=aSaNQtNpw4rkoGQh/uGZTm8fosgqw+mcaoB+lKT4j3z+3h63VXLsnB6dnVXE7zOIBa4D84liwwCoxFr1D+vJN6oZjkeljHscCUBtxPicKtA2ngRqUTKKDnWBdCsAkw31sImdTt8lRawRzN6EAhq+oKtQsgHGmeKfmdMDawyhCWA= 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 15692474652721003.627486805842; Mon, 23 Sep 2019 07:04:25 -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 8678C3086211; Mon, 23 Sep 2019 14:04:23 +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 51CD010016EB; Mon, 23 Sep 2019 14:04:23 +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 EF9BE180B76F; Mon, 23 Sep 2019 14:04:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8NE4Cxj006989 for ; Mon, 23 Sep 2019 10:04:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 99CE019D70; Mon, 23 Sep 2019 14:04:12 +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 2B6F719C78; Mon, 23 Sep 2019 14:04:10 +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 80740C01D36C; Mon, 23 Sep 2019 14:04:09 +0000 (UTC) Received: by mail-qk1-f171.google.com with SMTP id u184so15508669qkd.4; Mon, 23 Sep 2019 07:04:09 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id o124sm5298435qke.66.2019.09.23.07.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=40wZH2hs5BiqgK1rDcI8VLjlhb88medP/gEKtO2yEdc=; b=eavAuFuYrbnYSfAQsnS6q9IqmyZ7xmNE04MBw/8uTFkNOFlMSvMv0uq0dpoQ4qN6nV fkiGaEwmiNFqPhiJlRFb7Q3jU1a+rPF7ORdQv32B461YT5lIXsRyDGkHt2byh+cfZJKo sgWaVMS7ybn5RmbFhbtPn6zmuDCDyhwYEwZ/wqTzpnAD1E0YPWpjj6EZQIr0/RBQEZUE 4je7qmkuLcK0M1T9TpUU8lkBzLQFR+aSGIMl15ZIvUobq4KMzOMwXwIjNDWFKcn7bLj9 bd1SEzF4/qB8a/PzJ7yj2Uqs3haHyRos0rPU1AlwE/enDLMBewQOeyXQs6aED6ZgHEFB zLRw== 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=QmE4Dlbm1ID3/7u7jhmLQvGO3UaJ5FS53dGspfcFledD/GSvHYqbZn1NLd5dHlSNsr zEsClDIKZtFpzuT/QM1qDZhh7lY/tFx7AdaY3qApYHErEpfCWy92xynAyOp+bcokrqLA xWUBZkNhMxDuIHdI3PORp0OaefbI3UZmQrnbjK9l6MPZrdsmj4b8xAFxIc/roeniM6+C Sr4YCdZxgjLU+iRRRMck8WSvR1LmmFWiG5kgkXgHZUJZteohP64GaNxZb0FKWTbT7nqb +sbe5EQXrfW69F4Zg8EOmrORcNz0TRMNO2LvYyle+wYUo5bljALK41WzxqBPc8os3N1U VLoQ== X-Gm-Message-State: APjAAAUwcKcfqfM32euUKaqgSrx3lF76Jo523uMvV6U97h+eFKQWTyxJ s8ga8LdwY4G/fWeGYl7yN8zXUkPQ X-Google-Smtp-Source: APXvYqyhwOWRtOBm+3qp7XIkY+aK7YVlJvyxlG2t88BYcWgqmWuyTz2XcGxReX75l1P4SoFtJKeQpw== X-Received: by 2002:a37:7403:: with SMTP id p3mr16184576qkc.366.1569247448514; Mon, 23 Sep 2019 07:04:08 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 11:03:40 -0300 Message-Id: <20190923140343.1950-8-danielhb413@gmail.com> In-Reply-To: <20190923140343.1950-1-danielhb413@gmail.com> References: <20190923140343.1950-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]); Mon, 23 Sep 2019 14:04:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 23 Sep 2019 14:04:09 +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.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH 07/10] 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.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.42]); Mon, 23 Sep 2019 14:04:24 +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 Mon May 6 12:14:18 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=1569247479; cv=none; d=zoho.com; s=zohoarc; b=ZrS+Gpv5RCFLY7ZfzL8hQ6k9WZup+XG/WNi/MvU7zCqFkbFLEf10LPSJLqn1oozy2Yey1oBkHMNjl/vQdrIJIw1MtlxX/KTlv/w0sjrUyajx8cyrzb9dYZXLL6kj69m+eJvHmn2Ov8SpCRx2FiGbc1huDrzQqbUMSL/vk9E+ifI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247479; 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=7eOBbc7cfepry5t5RMRuOTF7ofxlo2Y/RW+CE0y6lTA=; b=SsS+fqO4IIxAqZiLto922O1Y+AFWS9ukSSaqzv/mNq+/rf4KiuOC6NuzZCH7/SxUYN3AfNvPZZmFiorfHoEIABeaJ/a4Y6MgpwaH9/w9W8FW1xG/z6cUTdX2BbzGnWoDizbpxGmKywIl75d4JSX9Shwf6LBxG2QhXARvfLb9/aI= 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 156924747994426.208607677785835; Mon, 23 Sep 2019 07:04:39 -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 8638E309BF09; Mon, 23 Sep 2019 14:04:37 +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 6140C1001B33; Mon, 23 Sep 2019 14:04: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 2780C180B761; Mon, 23 Sep 2019 14:04:37 +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 x8NE4Dlk006994 for ; Mon, 23 Sep 2019 10:04:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 23BFE5DC1B; Mon, 23 Sep 2019 14:04:13 +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 1C0BE5D9D5; Mon, 23 Sep 2019 14:04:13 +0000 (UTC) Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.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 1572DC058CA4; Mon, 23 Sep 2019 14:04:12 +0000 (UTC) Received: by mail-qk1-f179.google.com with SMTP id h126so15472666qke.10; Mon, 23 Sep 2019 07:04:12 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id o124sm5298435qke.66.2019.09.23.07.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:04:09 -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=1podIevalJ2Nak8MrrauaCfYMh4sJetVaAjzcP7z01M=; b=QVSune7v2XcqzuM4XX2Q7quujoRQKYeX+uqEo8Rvafxv1QBTgn0SFnLD20HCz7dvie 6LfxjRlJMZ3gQuM0wtbBHqmltxoTwDcEE64c3EFKxGe7kARcHxCUQHQZsuzbmuix3wr+ dj2naUL79sPNK+z3gU717EepFsniE8CjZShsPtgaVINWK9X32OyYnb4i4V03QxbyoKBC 62OeZHQ1sD/YJcCBeI5uB0k14/u7VdZbfGPaNInZ4b8Bn4aMAn+mV4B6/Co3PMB6WXek QwnGkmdBCujYWrJLyR/aSrOtnaODxCx5p7q5uwP9cq3QB1FDUH4NjN5MG/3iJVnVS8gY xWOw== 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=1podIevalJ2Nak8MrrauaCfYMh4sJetVaAjzcP7z01M=; b=ZwAawhNpi3L3YyYZLWqmIfkfbFE/4dqBEzh1z+KL8hlQoDsnUViGTJh1Kmo+kebYmB vCeTURTxTBwb+5zXB4nQ1oQpeXgjN5DJbFL4R520q8IvNUDFcB+yUA66sdHigwl3nkOp N+fjWuykbTva1b+RnwvzSAB/LQ6uW3legCaznes6WDokC5SKEOgFS3lBXGBSQEBfprf2 yY4UbcGK5zqQqLHesBUY/hiCmb8Y7MH6olg3ub2XytVhLdKKtopqkyI7P+c+dZmb1Q/J 21BdzHSM1NcIgF1cuWu6FE2wM/lQPEDc2HBQ622iqdcsyUhRStvl+51Y9w9MfL28ouVS 6mEA== X-Gm-Message-State: APjAAAXGqNHVs4TIJ7g3MXOgq14QOX+dSnF1RtTNgCwVzpSgA6CfpoF5 uCJAymxUgL3DrFGKwNzte4ToWWi+ X-Google-Smtp-Source: APXvYqxAvZPy32XTYPNYE8yNjDiQoQ86gr6pDcsi8ctM9Rb0WnmyHnKq/y/peHXIxxoMDIKGx166Og== X-Received: by 2002:a37:660c:: with SMTP id a12mr17364514qkc.70.1569247451097; Mon, 23 Sep 2019 07:04:11 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 11:03:41 -0300 Message-Id: <20190923140343.1950-9-danielhb413@gmail.com> In-Reply-To: <20190923140343.1950-1-danielhb413@gmail.com> References: <20190923140343.1950-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]); Mon, 23 Sep 2019 14:04:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 23 Sep 2019 14:04:12 +0000 (UTC) for IP:'209.85.222.179' DOMAIN:'mail-qk1-f179.google.com' HELO:'mail-qk1-f179.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.179 mail-qk1-f179.google.com 209.85.222.179 mail-qk1-f179.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH 08/10] 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.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.45]); Mon, 23 Sep 2019 14:04:38 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The existing QEMU URI path validation considers that a privileged user can use a "/session" URI as well. Let's update virConnectValidateURIPath() to consider this usage, allowing us to use the function inside qemu_driver.c. Although the existing callers of virConnectValidateURIPath() didn't consider that a privileged user could connect with "/session", it is sensible to consider that this should be the case. thus no serious harm is done. Suggested-by: Cole Robinson Signed-off-by: Daniel Henrique Barboza --- src/driver.c | 3 ++- src/qemu/qemu_driver.c | 20 ++++---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/driver.c b/src/driver.c index e627b0c1d7..f9c41383dc 100644 --- a/src/driver.c +++ b/src/driver.c @@ -276,7 +276,8 @@ virConnectValidateURIPath(const char *uriPath, bool privileged) { if (privileged) { - if (STRNEQ(uriPath, "/system")) { + if (STRNEQ(uriPath, "/system") && + STRNEQ(uriPath, "/session")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected %s URI path '%s', try %s:///syste= m"), entityName, uriPath, entityName); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0753904472..05025e7251 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 May 6 12:14:18 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=1569247480; cv=none; d=zoho.com; s=zohoarc; b=dRCDBKUz+f+QPx0g2e01fEbrRmw9ed02k5gVs46fhZs81cTTVbnGO5+XH4bGpd0cZIZVgaI2ih2muw/FpVQYmdRNGCXetLZ/794KLdF1bGn55R7x3LWmS9uT7thaASmQrVN9olPSmU8ntU0HQS1b2gP24iRLbUp1g9BVtstPR0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247480; 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=oigQwYA/ExDUalBo9EXx7ROzwd8gUr8t/ohJXgXoel8SO6/Fyg4dH0POrrmxgSq5y87d9tOV1Ch8Wrl7tFOkR0Y8yBFQClNwRRhorl2AAqQmqUssvlYDZ0vsXyeBmwV6NZap/Hh2qgkipTmPHCZADEWhfwpN67R3dtlVfde6doE= 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 1569247480119941.0134894207358; Mon, 23 Sep 2019 07:04: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 2E73D10CC1F9; Mon, 23 Sep 2019 14:04:37 +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 0B7B46012D; Mon, 23 Sep 2019 14:04: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 BE5AE180B536; Mon, 23 Sep 2019 14:04:36 +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 x8NE4Mmw007033 for ; Mon, 23 Sep 2019 10:04:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id ADDD35D71C; Mon, 23 Sep 2019 14:04:22 +0000 (UTC) Received: from mx1.redhat.com (ext-mx24.extmail.prod.ext.phx2.redhat.com [10.5.110.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA5E65D784; Mon, 23 Sep 2019 14:04:15 +0000 (UTC) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (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 91CF410CC1E0; Mon, 23 Sep 2019 14:04:14 +0000 (UTC) Received: by mail-qt1-f178.google.com with SMTP id c3so17217756qtv.10; Mon, 23 Sep 2019 07:04:14 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id o124sm5298435qke.66.2019.09.23.07.04.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BU0iQGc1S0P5Uat9Mv5QunKxue/pjQrAzhTy4NehCw4=; b=p0im4hRVsBDT51qBFXybJGBU8Jofh4jeuFnpI96RorfBwk4GVTZc9m/biMYLX+tBbl 3GpRbalegIiJ+NDHEuTjtHhZzL5eNjcMw+09GxdARI+VCoemINi7E6MkIUQyckUjWymh oAjyyzZnMOxzPkBSDhNiG9cUPHYUmHbdaTTwsXDIN+OQRaKxNd1nSv+sen6jp17Fzdah qmVhBDeytQ8TOdZrAGb4+u1vfIa0KKGsLWdGrdQzGwSQVWZxyFEsuwJ7aB7cWOr4CrsL EWclBww6Qu+D08SfFIhHYnC4QLRiwxHHfVZ5rfYKYANXn/1gdiaXm4zS5h6QtwhwPw2l ZpmA== 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=jZ/p2CEYxcosjnE54VFTnOpUe4DaGFIeZOlQHRb5expho7xktz7ceUe/Aygyh1lvrd RoTkYe8vWUg51hBdY8iSSJ91mxW2lC+L6frFno81tlINu2WbKhID6BZBKKgCQ4IqiqpX ZnjN5n/GEsa+MiqIK4u9E7kPZCwEWZUmYf6ziilqJEBZsr6UBK5lfZJFgJI00ivSIgyn 7nrteTsU4KO227J9EsmCswl+9Bl6inLK2Wdx724zxNQrP+P6n/vV/VW6Qv2TZWyjG8Zt mcXS3hRN8Nh7c3GRTrqjldyLAxeDUyyhWByLwE/SfKWyEW3IXEIYheKOgMkdssqVYwlW MMgg== X-Gm-Message-State: APjAAAUaxfCuBeYZmDGyVDdzfOHqUP2sm33k8A0xbECePreSB8Avw3r4 vOZOf58MR3ShFaSbJ4TW4f3e8OWa X-Google-Smtp-Source: APXvYqyhzCqtajb1vVMIGlGMUe6+GZRERZMUr/voz1f+LXDsgIL8GNZOInf5VQ8SQRB4wF0Ax5PbWQ== X-Received: by 2002:a0c:9952:: with SMTP id i18mr25011816qvd.202.1569247453532; Mon, 23 Sep 2019 07:04:13 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 11:03:42 -0300 Message-Id: <20190923140343.1950-10-danielhb413@gmail.com> In-Reply-To: <20190923140343.1950-1-danielhb413@gmail.com> References: <20190923140343.1950-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.65]); Mon, 23 Sep 2019 14:04:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Mon, 23 Sep 2019 14:04:14 +0000 (UTC) for IP:'209.85.160.178' DOMAIN:'mail-qt1-f178.google.com' HELO:'mail-qt1-f178.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.178 mail-qt1-f178.google.com 209.85.160.178 mail-qt1-f178.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.65 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH 09/10] 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Mon, 23 Sep 2019 14:04:37 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Suggested-by: Cole Robinson Signed-off-by: Daniel Henrique Barboza --- src/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 May 6 12:14:18 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=1569247473; cv=none; d=zoho.com; s=zohoarc; b=Te05ZOqDhOxW2sthzscJ/WHlMcz2aD4uL76dffRgaeP79GIAMfPYw7WMM9scAippVZWyFyJl+Mv0dMNWPLVeN2lYYZl9woj+Q+rywiaHAXNiJ8WboIo5H98SYypcj91KZjf/RCq7tSxWemiJFGOvdlV/OadhqUA0KLgqgxqaw4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569247473; 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=YoSIMoPmB6Czot/RgSm4Daor1KEccfW5HYYtX/YemV2qRq76k7FGqJ8s9DIaBrKG9i6BRrzK/xVobIqoiSp9d7VbZ3e5nUjwEvMWVsYPFJGlJbdj1jYYgb8VgGrE933zExthhEV/7SBZcm4afumienYn1KUjPc333vJAnOapK+M= 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 1569247473083465.1446086983291; Mon, 23 Sep 2019 07:04:33 -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 99F85C049E10; Mon, 23 Sep 2019 14:04:31 +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 6FCC464026; Mon, 23 Sep 2019 14:04:31 +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 2566C4EE50; Mon, 23 Sep 2019 14:04:31 +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 x8NE4KAa007021 for ; Mon, 23 Sep 2019 10:04:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 254651001B30; Mon, 23 Sep 2019 14:04:20 +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 3239D10013D9; Mon, 23 Sep 2019 14:04:17 +0000 (UTC) Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) (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 882512107; Mon, 23 Sep 2019 14:04:16 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id x5so17254038qtr.7; Mon, 23 Sep 2019 07:04:16 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:df05:2a1f:6ce3:83c3:51c0]) by smtp.gmail.com with ESMTPSA id o124sm5298435qke.66.2019.09.23.07.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 07:04:15 -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=CBZ4nD0Yjjjy47ZDGGHz58FqF/RFNJ4TTMaJOnsDAJwH+J7uPtdCAanL/ebaWdR+xA 1jjd10Y/SLWOMEbqllwg3y9r/QQ7/9WKroybIzQwdK7RdTB3fNxiHP4eOj9l0HTSOBim aBF3V9S1gcb/QQ3uPr6hg15AfqtlWsJFiWobvG2ipKw2zFl1bujP4kBUhzlwQas0Sgsg 9JPFlJHYD9oYQdbrp2X88waiX7BCxGXunZ2GDoPghGESkydWcEZqRt0t2eyDMuTcwtT7 ttLsjyGkUNVMTyaQo2rikQHznC7l2TDkt5F9Pw9YmyxoNLV7RUBY+j1lamhU54h5MBKw z93Q== 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=JQTgft+cA2No5Omv57ELPEh246/XxeyJfZe+IiLzNCyPIbtq+XokZZOwP75M29Rs4E Hx7dv7DaEf6J5rSxnKhHyOiXaTgKN/g/gVqbNF+6bjJZ2VX04M1BLgbbYegxl2Wbg/0r imgzESLxj67zCg0fSSG4XCtR2o6NiNBkgBQq1NdaEGRYHR8XReVY2eEj+wQFucjj6xxx 5gOJyEf7TbS7yzFzahN9vw3IWLbdJN2WSeSXZAWdimhB+7N+KgcfxyGixC9BmMXnsls1 ZvUKSyaZKvBb9EyCURZJPLyUsVQh0+c34i/B5HLx383tWBAGtAAaBDOO19drPiQp36kK u/Lw== X-Gm-Message-State: APjAAAXAEsNcSrmCU9K2n4uDeC9zk3yGZgfv7lUDuYM1UYaWjulwO6CB OwulZ1sLk6x2VpMSA++xS8WrudSh X-Google-Smtp-Source: APXvYqzLIzVC2tzly1v+V8mze+siizfCsEoeX9qsBra4egwrPvFgT/T3UcvPz1E86h4Ak2Xx/JOYxg== X-Received: by 2002:a0c:f9c3:: with SMTP id j3mr24002114qvo.193.1569247455667; Mon, 23 Sep 2019 07:04:15 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 23 Sep 2019 11:03:43 -0300 Message-Id: <20190923140343.1950-11-danielhb413@gmail.com> In-Reply-To: <20190923140343.1950-1-danielhb413@gmail.com> References: <20190923140343.1950-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 14:04:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 23 Sep 2019 14:04:16 +0000 (UTC) for IP:'209.85.160.195' DOMAIN:'mail-qt1-f195.google.com' HELO:'mail-qt1-f195.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.195 mail-qt1-f195.google.com 209.85.160.195 mail-qt1-f195.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.71 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH 10/10] 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 23 Sep 2019 14:04:32 +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